Bug 1203724 - Keep focus in the urlbar after making a choice in the search suggestions opt-in notification via an accesskey. r=mak
authorDrew Willcoxon <adw@mozilla.com>
Wed, 16 Sep 2015 11:16:44 -0700
changeset 297154 ece591e2a86291760b5b6880dbe85cb28e14969a
parent 297153 1ab7fb448f605b6b4fabec673efc4ad890412834
child 297155 44fc4c98e5fe9fd5e32b7d394f5be15a724391d4
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmak
bugs1203724
milestone43.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 1203724 - Keep focus in the urlbar after making a choice in the search suggestions opt-in notification via an accesskey. r=mak
browser/base/content/urlbarBindings.xml
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -660,16 +660,22 @@ file, You can obtain one at http://mozil
                 this.timeout = this._prefs.getIntPref(aData);
                 break;
               case "formatting.enabled":
                 this._formattingEnabled = this._prefs.getBoolPref(aData);
                 break;
               case "userMadeSearchSuggestionsChoice":
                 this._userMadeSearchSuggestionsChoice =
                   this._prefs.getBoolPref(aData);
+                // Make sure the urlbar is focused.  It won't be, for example,
+                // if the user used an accesskey to make an opt-in choice.
+                // mIgnoreFocus prevents the text from being selected.
+                this.mIgnoreFocus = true;
+                this.focus();
+                this.mIgnoreFocus = false;
                 this.popup.searchSuggestionsNotificationWasDismissed(
                   this._prefs.getBoolPref("suggest.searches")
                 );
                 break;
               case "trimURLs":
                 this._mayTrimURLs = this._prefs.getBoolPref(aData);
                 break;
               case "unifiedcomplete":