Bug 1145394 - Use AppConstants for prefs code (r=gavin)
☠☠ backed out by 7ff3c70a5ad2 ☠ ☠
authorBill McCloskey <billm@mozilla.com>
Thu, 19 Mar 2015 15:28:39 -0700
changeset 234720 8626a98a34d83f9b7228a455f46b0abdaed6a216
parent 234719 347dbe653fb3083e0bbebee31ec890af8b23e70a
child 234721 f7c5c5c8bdffac69375cda4465bdb69fdfebbec2
push id57232
push userwmccloskey@mozilla.com
push dateFri, 20 Mar 2015 18:57:48 +0000
treeherdermozilla-inbound@72c740d37eb9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs1145394
milestone39.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1145394 - Use AppConstants for prefs code (r=gavin)
browser/components/preferences/applications.js
browser/components/preferences/in-content/applications.js
browser/components/preferences/in-content/jar.mn
browser/components/preferences/jar.mn
--- a/browser/components/preferences/applications.js
+++ b/browser/components/preferences/applications.js
@@ -8,16 +8,17 @@
 //****************************************************************************//
 // Constants & Enumeration Values
 
 var Cc = Components.classes;
 var Ci = Components.interfaces;
 var Cr = Components.results;
 
 Components.utils.import('resource://gre/modules/Services.jsm');
+Components.utils.import('resource://gre/modules/AppConstants.jsm');
 
 const TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed";
 const TYPE_MAYBE_VIDEO_FEED = "application/vnd.mozilla.maybe.video.feed";
 const TYPE_MAYBE_AUDIO_FEED = "application/vnd.mozilla.maybe.audio.feed";
 const TYPE_PDF = "application/pdf";
 
 const PREF_PDFJS_DISABLED = "pdfjs.disabled";
 const TOPIC_PDFJS_HANDLER_CHANGED = "pdfjs:handlerChanged";
@@ -68,27 +69,19 @@ const PREF_AUDIO_FEED_SELECTED_ACTION = 
 const PREF_AUDIO_FEED_SELECTED_READER = "browser.audioFeeds.handler.default";
 
 // The nsHandlerInfoAction enumeration values in nsIHandlerInfo identify
 // the actions the application can take with content of various types.
 // But since nsIHandlerInfo doesn't support plugins, there's no value
 // identifying the "use plugin" action, so we use this constant instead.
 const kActionUsePlugin = 5;
 
-/*
-#ifdef MOZ_WIDGET_GTK
-*/
-const ICON_URL_APP      = "moz-icon://dummy.exe?size=16";
-/*
-#else
-*/
-const ICON_URL_APP      = "chrome://browser/skin/preferences/application.png";
-/*
-#endif
-*/
+const ICON_URL_APP = AppConstants.platform == "linux" ?
+                     "moz-icon://dummy.exe?size=16" :
+                     "chrome://browser/skin/preferences/application.png";
 
 // For CSS. Can be one of "ask", "save", "plugin" or "feed". If absent, the icon URL
 // was set by us to a custom handler icon and CSS should not try to override it.
 const APP_ICON_ATTR_NAME = "appHandlerIcon";
 
 //****************************************************************************//
 // Utilities
 
--- a/browser/components/preferences/in-content/applications.js
+++ b/browser/components/preferences/in-content/applications.js
@@ -3,16 +3,17 @@
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 //****************************************************************************//
 // Constants & Enumeration Values
 
 Components.utils.import('resource://gre/modules/Services.jsm');
+Components.utils.import('resource://gre/modules/AppConstants.jsm');
 const TYPE_MAYBE_FEED = "application/vnd.mozilla.maybe.feed";
 const TYPE_MAYBE_VIDEO_FEED = "application/vnd.mozilla.maybe.video.feed";
 const TYPE_MAYBE_AUDIO_FEED = "application/vnd.mozilla.maybe.audio.feed";
 const TYPE_PDF = "application/pdf";
 
 const PREF_PDFJS_DISABLED = "pdfjs.disabled";
 const TOPIC_PDFJS_HANDLER_CHANGED = "pdfjs:handlerChanged";
 
@@ -62,27 +63,19 @@ const PREF_AUDIO_FEED_SELECTED_ACTION = 
 const PREF_AUDIO_FEED_SELECTED_READER = "browser.audioFeeds.handler.default";
 
 // The nsHandlerInfoAction enumeration values in nsIHandlerInfo identify
 // the actions the application can take with content of various types.
 // But since nsIHandlerInfo doesn't support plugins, there's no value
 // identifying the "use plugin" action, so we use this constant instead.
 const kActionUsePlugin = 5;
 
-/*
-#if MOZ_WIDGET_GTK == 2
-*/
-const ICON_URL_APP      = "moz-icon://dummy.exe?size=16";
-/*
-#else
-*/
-const ICON_URL_APP      = "chrome://browser/skin/preferences/application.png";
-/*
-#endif
-*/
+const ICON_URL_APP = AppConstants.platform == "linux" ?
+                     "moz-icon://dummy.exe?size=16" :
+                     "chrome://browser/skin/preferences/application.png";
 
 // For CSS. Can be one of "ask", "save", "plugin" or "feed". If absent, the icon URL
 // was set by us to a custom handler icon and CSS should not try to override it.
 const APP_ICON_ATTR_NAME = "appHandlerIcon";
 
 //****************************************************************************//
 // Utilities
 
--- a/browser/components/preferences/in-content/jar.mn
+++ b/browser/components/preferences/in-content/jar.mn
@@ -5,14 +5,14 @@
 browser.jar:
    content/browser/preferences/in-content/preferences.js
 *  content/browser/preferences/in-content/preferences.xul
    content/browser/preferences/in-content/subdialogs.js
 
 *  content/browser/preferences/in-content/main.js
 *  content/browser/preferences/in-content/privacy.js
 *  content/browser/preferences/in-content/advanced.js
-*  content/browser/preferences/in-content/applications.js
+   content/browser/preferences/in-content/applications.js
    content/browser/preferences/in-content/content.js
    content/browser/preferences/in-content/sync.js
    content/browser/preferences/in-content/security.js
    content/browser/preferences/in-content/search.css
    content/browser/preferences/in-content/search.js
--- a/browser/components/preferences/jar.mn
+++ b/browser/components/preferences/jar.mn
@@ -5,17 +5,17 @@
 browser.jar:
     content/browser/preferences/aboutPermissions.xul
     content/browser/preferences/aboutPermissions.js
     content/browser/preferences/aboutPermissions.css
     content/browser/preferences/aboutPermissions.xml
 *   content/browser/preferences/advanced.xul
 *   content/browser/preferences/advanced.js
     content/browser/preferences/applications.xul
-*   content/browser/preferences/applications.js
+    content/browser/preferences/applications.js
     content/browser/preferences/applicationManager.xul
 *   content/browser/preferences/applicationManager.js
 *   content/browser/preferences/colors.xul
 *   content/browser/preferences/cookies.xul
 *   content/browser/preferences/cookies.js
     content/browser/preferences/content.xul
     content/browser/preferences/content.js
 *   content/browser/preferences/connection.xul