Bug 883390 - Part 1.1 - Ensure that browser search engines are updated when settings are changed. r=sfoster
authorJonathan Wilde <jwilde@jwilde.me>
Mon, 15 Jul 2013 11:24:50 -0700
changeset 138551 47a9f741253c252a24061ff8c9a69f1c33579c6b
parent 138550 e9bb67dba984f79763d783ff66933547dc58a5ff
child 138552 9434d96e85b5a08852a809f79c0044b776f622d4
push id24961
push useremorley@mozilla.com
push dateTue, 16 Jul 2013 08:58:21 +0000
treeherdermozilla-central@41ed26826acb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfoster
bugs883390
milestone25.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 883390 - Part 1.1 - Ensure that browser search engines are updated when settings are changed. r=sfoster
browser/metro/base/content/bindings/urlbar.xml
--- a/browser/metro/base/content/bindings/urlbar.xml
+++ b/browser/metro/base/content/bindings/urlbar.xml
@@ -635,25 +635,25 @@
               item.setAttribute("iconURI", iconURI);
             }
 
             this._results.arrangeItems();
           ]]>
         </body>
       </method>
 
-      <method name="updateSearchEngines">
+      <method name="_initSearchEngines">
         <body>
           <![CDATA[
-            Services.search.init(this._onSearchServiceInit.bind(this));
+            Services.search.init(this.updateSearchEngineGrid.bind(this));
           ]]>
         </body>
       </method>
 
-      <method name="_onSearchServiceInit">
+      <method name="updateSearchEngineGrid">
         <body>
           <![CDATA[
             if (!this._isGridBound(this._searches))
               return;
 
             this._engines = Services.search.getVisibleEngines();
 
             while (this._searches.itemCount > 0)
@@ -763,21 +763,21 @@
       <!-- nsIObserver -->
 
       <method name="observe">
         <parameter name="aSubject"/>
         <parameter name="aTopic"/>
         <parameter name="aData"/>
         <body>
           <![CDATA[
-            if (aTopic != "browser-search-engine-modified" ||
-                aData != "engine-changed")
-              return;
-
-            this.updateSearchEngines();
+            switch (aTopic) {
+              case "browser-search-engine-modified":
+                this.updateSearchEngineGrid();
+                break;
+            }
           ]]>
         </body>
       </method>
 
       <!-- Helpers -->
 
       <field name="_engines">[]</field>
       <field name="_grid">null</field>
@@ -806,17 +806,17 @@
     </implementation>
 
     <handlers>
       <handler event="contentgenerated">
         <![CDATA[
           let grid = event.originalTarget;
 
           if (grid == this._searches)
-            this.updateSearchEngines();
+            this._initSearchEngines();
 
           if (grid == this._results)
             this.updateResults();
         ]]>
       </handler>
     </handlers>
   </binding>
 </bindings>