Bug 1106150 - Fix condition="defaultEngine" MozParam, r=markh, a=sledru
authorGavin Sharp <gavin.sharp@gmail.com>
Fri, 28 Nov 2014 12:35:00 -0800
changeset 242642 cbc30399130890bb8e6db3baaf2cf334a258dd7d
parent 242641 9b2625c9dc23adf9ff74720449b1c1770986c3b0
child 242643 5deadff8cf18f43d5d0894e228e7880686876612
push id4311
push userraliiev@mozilla.com
push dateMon, 12 Jan 2015 19:37:41 +0000
treeherdermozilla-beta@150c9fed433b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmarkh, sledru
bugs1106150
milestone36.0a2
Bug 1106150 - Fix condition="defaultEngine" MozParam, r=markh, a=sledru
toolkit/components/search/nsSearchService.js
--- a/toolkit/components/search/nsSearchService.js
+++ b/toolkit/components/search/nsSearchService.js
@@ -1904,18 +1904,22 @@ Engine.prototype = {
 
     this._urls.push(url);
   },
 
   _isDefaultEngine: function SRCH_ENG__isDefaultEngine() {
     let defaultPrefB = Services.prefs.getDefaultBranch(BROWSER_SEARCH_PREF);
     let nsIPLS = Ci.nsIPrefLocalizedString;
     let defaultEngine;
+    let pref = "defaultenginename";
+    if (getIsUS()) {
+      pref += ".US";
+    }
     try {
-      defaultEngine = defaultPrefB.getComplexValue("defaultenginename", nsIPLS).data;
+      defaultEngine = defaultPrefB.getComplexValue(pref, nsIPLS).data;
     } catch (ex) {}
     return this.name == defaultEngine;
   },
 
   /**
    * Get the icon from an OpenSearch Image element.
    * @see http://opensearch.a9.com/spec/1.1/description/#image
    */