From ac7ba8c9b99531d7aba5997045a0b1c9f8eedae0 Mon Sep 17 00:00:00 2001 From: Gijs Kruitbosch Date: Tue, 17 Dec 2013 13:43:50 -0500 Subject: [PATCH 01/17] Bug 700363 - [Australis] Hide conditional forward button permanently when not in use to prevent accidental glitches. r=Unfocused,jaws --HG-- extra : rebase_source : 981cf692f5e7df0b4dc59a4eb926915363de1fec --- browser/base/content/browser-customization.js | 2 + browser/base/content/browser.js | 50 ++++++++++++++++++- browser/themes/osx/browser.css | 10 +++- browser/themes/windows/browser.css | 10 +++- 4 files changed, 69 insertions(+), 3 deletions(-) diff --git a/browser/base/content/browser-customization.js b/browser/base/content/browser-customization.js index 369f6cbd22c..4d15dea8c8d 100644 --- a/browser/base/content/browser-customization.js +++ b/browser/base/content/browser-customization.js @@ -40,6 +40,7 @@ let CustomizationHandler = { } CombinedStopReload.uninit(); + CombinedBackForward.uninit(); PlacesToolbarHelper.customizeStart(); BookmarkingUI.customizeStart(); DownloadsButton.customizeStart(); @@ -76,6 +77,7 @@ let CustomizationHandler = { // The url bar splitter state is dependent on whether stop/reload // and the location bar are combined, so we need this ordering CombinedStopReload.init(); + CombinedBackForward.init(); UpdateUrlbarSearchSplitterState(); // Update the urlbar diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index a4e70625e72..827a5f60438 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -251,7 +251,15 @@ function UpdateBackForwardCommands(aWebNavigation) { backBroadcaster.setAttribute("disabled", true); } - if (forwardDisabled == aWebNavigation.canGoForward) { + let canGoForward = aWebNavigation.canGoForward; + if (forwardDisabled) { + // Force the button to either be hidden (if we are already disabled, + // and should be), or to show if we're about to un-disable it: + // otherwise no transition will occur and it'll never show: + CombinedBackForward.setForwardButtonOcclusion(!canGoForward); + } + + if (forwardDisabled == canGoForward) { if (forwardDisabled) forwardBroadcaster.removeAttribute("disabled"); else @@ -904,6 +912,7 @@ var gBrowserInit = { // Misc. inits. CombinedStopReload.init(); + CombinedBackForward.init(); gPrivateBrowsingUI.init(); TabsInTitlebar.init(); @@ -1221,6 +1230,7 @@ var gBrowserInit = { // uninit methods don't depend on the services having been initialized). CombinedStopReload.uninit(); + CombinedBackForward.uninit(); gGestureSupport.init(false); @@ -3775,6 +3785,7 @@ var XULBrowserWindow = { onUpdateCurrentBrowser: function XWB_onUpdateCurrentBrowser(aStateFlags, aStatus, aMessage, aTotalProgress) { if (FullZoom.updateBackgroundTabs) FullZoom.onLocationChange(gBrowser.currentURI, true); + CombinedBackForward.setForwardButtonOcclusion(!gBrowser.webProgress.canGoForward); var nsIWebProgressListener = Components.interfaces.nsIWebProgressListener; var loadingDone = aStateFlags & nsIWebProgressListener.STATE_STOP; // use a pseudo-object instead of a (potentially nonexistent) channel for getting @@ -3849,6 +3860,43 @@ var LinkTargetDisplay = { } }; +let CombinedBackForward = { + init: function() { + this.forwardButton = document.getElementById("forward-button"); + // Add a transition listener to the url bar to hide the forward button + // when necessary + if (gURLBar) + gURLBar.addEventListener("transitionend", this); + // On startup, or if the user customizes, our listener isn't attached, + // and no transitions fire anyway, so we need to make sure we've hidden the + // button if necessary: + if (this.forwardButton && this.forwardButton.hasAttribute("disabled")) { + this.setForwardButtonOcclusion(true); + } + }, + uninit: function() { + if (gURLBar) + gURLBar.removeEventListener("transitionend", this); + }, + handleEvent: function(aEvent) { + if (aEvent.type == "transitionend" && + (aEvent.propertyName == "margin-left" || aEvent.propertyName == "margin-right") && + this.forwardButton.hasAttribute("disabled")) { + this.setForwardButtonOcclusion(true); + } + }, + setForwardButtonOcclusion: function(shouldBeOccluded) { + if (!this.forwardButton) + return; + + let hasAttribute = this.forwardButton.hasAttribute("occluded-by-urlbar"); + if (shouldBeOccluded && !hasAttribute) + this.forwardButton.setAttribute("occluded-by-urlbar", "true"); + else if (!shouldBeOccluded && hasAttribute) + this.forwardButton.removeAttribute("occluded-by-urlbar"); + } +} + var CombinedStopReload = { init: function () { if (this._initialized) diff --git a/browser/themes/osx/browser.css b/browser/themes/osx/browser.css index 58db79bb397..bc43ece1d2e 100644 --- a/browser/themes/osx/browser.css +++ b/browser/themes/osx/browser.css @@ -1280,6 +1280,10 @@ toolbar .toolbarbutton-1:not([type="menu-button"]), opacity: 0; } +@conditionalForwardWithUrlbar@ > #forward-button[occluded-by-urlbar] { + visibility: hidden; +} + @media (-moz-mac-lion-theme) { #forward-button:not(:-moz-lwtheme) { background-image: linear-gradient(hsla(0,0%,100%,.73), hsla(0,0%,100%,.05) 85%); @@ -1540,8 +1544,10 @@ toolbar .toolbarbutton-1:not([type="menu-button"]), transition-delay: 100s; } +@conditionalForwardWithUrlbar@[forwarddisabled][switchingtabs] + #urlbar-container > #urlbar, @conditionalForwardWithUrlbar@[forwarddisabled]:not(:hover) > #urlbar-wrapper > #urlbar { - /* when not hovered anymore, trigger a new transition to hide the forward button immediately */ + /* when switching tabs, or when not hovered anymore, trigger a new transition + * to hide the forward button immediately */ margin-left: -@conditionalForwardWithUrlbarWidth@.01px; } @@ -1594,10 +1600,12 @@ toolbar .toolbarbutton-1:not([type="menu-button"]), transition-delay: 100s; } +@conditionalForwardWithUrlbar@[forwarddisabled][switchingtabs] + #urlbar-container > #urlbar > #notification-popup-box[hidden] + #identity-box:-moz-locale-dir(ltr), @conditionalForwardWithUrlbar@[forwarddisabled]:not(:hover) > #urlbar-wrapper > #urlbar > #notification-popup-box[hidden] + #identity-box:-moz-locale-dir(ltr) { padding-left: 10.01px; } +@conditionalForwardWithUrlbar@[forwarddisabled][switchingtabs] + #urlbar-container > #urlbar > #notification-popup-box[hidden] + #identity-box:-moz-locale-dir(rtl), @conditionalForwardWithUrlbar@[forwarddisabled]:not(:hover) > #urlbar-wrapper > #urlbar > #notification-popup-box[hidden] + #identity-box:-moz-locale-dir(rtl) { padding-right: 10.01px; } diff --git a/browser/themes/windows/browser.css b/browser/themes/windows/browser.css index 33eb69e814e..a822dfa5cef 100644 --- a/browser/themes/windows/browser.css +++ b/browser/themes/windows/browser.css @@ -633,6 +633,10 @@ menuitem.bookmark-item { opacity: 0; } +@conditionalForwardWithUrlbar@ > #forward-button[occluded-by-urlbar] { + visibility: hidden; +} + #back-button { padding-top: 3px !important; padding-bottom: 3px !important; @@ -891,8 +895,10 @@ menuitem.bookmark-item { transition-delay: 100s; } +@conditionalForwardWithUrlbar@[forwarddisabled][switchingtabs] + #urlbar-container > #urlbar, @conditionalForwardWithUrlbar@[forwarddisabled]:not(:hover) > #urlbar-wrapper > #urlbar { - /* when not hovered anymore, trigger a new transition to hide the forward button immediately */ + /* when switching tabs, or when not hovered anymore, trigger a new transition + * to hide the forward button immediately */ margin-left: -@conditionalForwardWithUrlbarWidth@.01px; } @@ -1011,11 +1017,13 @@ html|*.urlbar-input:-moz-lwtheme::-moz-placeholder, transition-delay: 100s; } +@conditionalForwardWithUrlbar@[forwarddisabled][switchingtabs] + #urlbar-container > #urlbar > #notification-popup-box[hidden] + #identity-box:-moz-locale-dir(ltr), @conditionalForwardWithUrlbar@[forwarddisabled]:not(:hover) > #urlbar-wrapper > #urlbar > #notification-popup-box[hidden] + #identity-box:-moz-locale-dir(ltr) { /* when not hovered anymore, trigger a new non-delayed transition to react to the forward button hiding */ padding-left: 5.01px; } +@conditionalForwardWithUrlbar@[forwarddisabled][switchingtabs] + #urlbar-container > #urlbar > #notification-popup-box[hidden] + #identity-box:-moz-locale-dir(rtl), @conditionalForwardWithUrlbar@[forwarddisabled]:not(:hover) > #urlbar-wrapper > #urlbar > #notification-popup-box[hidden] + #identity-box:-moz-locale-dir(rtl) { /* when not hovered anymore, trigger a new non-delayed transition to react to the forward button hiding */ padding-right: 5.01px; From 7befddc5616bcc29915cf5b33ed8efed9459d306 Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Tue, 17 Dec 2013 13:44:14 -0500 Subject: [PATCH 02/17] Bug 933961 - [Australis] Hide the tab-view-deck background during customization transition. r=mconley --HG-- extra : rebase_source : 6e913265db2b56ad1c8c7794e9e7f7ca5ec62ad5 --- browser/themes/linux/browser.css | 2 +- browser/themes/osx/browser.css | 2 +- browser/themes/windows/browser.css | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/browser/themes/linux/browser.css b/browser/themes/linux/browser.css index cf55ed29c07..8a17fd7825f 100644 --- a/browser/themes/linux/browser.css +++ b/browser/themes/linux/browser.css @@ -1839,7 +1839,7 @@ chatbox { %include ../shared/customizableui/customizeMode.inc.css -#main-window[customizing] #tab-view-deck { +#main-window[customize-entered] #tab-view-deck { background-image: url("chrome://browser/skin/customizableui/customizeMode-gridTexture.png"), url("chrome://browser/skin/customizableui/background-noise-toolbar.png"), linear-gradient(to bottom, #bcbcbc, #b5b5b5); diff --git a/browser/themes/osx/browser.css b/browser/themes/osx/browser.css index bc43ece1d2e..62f16b9d67b 100644 --- a/browser/themes/osx/browser.css +++ b/browser/themes/osx/browser.css @@ -3953,7 +3953,7 @@ window > chatbox { padding: 0 2em 2em; } -#main-window[customizing] #tab-view-deck { +#main-window[customize-entered] #tab-view-deck { background-image: url("chrome://browser/skin/customizableui/customizeMode-gridTexture.png"), url("chrome://browser/skin/customizableui/background-noise-toolbar.png"), linear-gradient(to bottom, rgb(233,233,233), rgb(178,178,178) 21px); diff --git a/browser/themes/windows/browser.css b/browser/themes/windows/browser.css index a822dfa5cef..58d57e13d61 100644 --- a/browser/themes/windows/browser.css +++ b/browser/themes/windows/browser.css @@ -2418,7 +2418,7 @@ chatbox { %include ../shared/customizableui/customizeMode.inc.css -#main-window[customizing] { +#main-window[customize-entered] { background-image: url("chrome://browser/skin/customizableui/customizeMode-gridTexture.png"); background-attachment: fixed; } From 32e7a01ddf3e56085ee61c100a3025db43ba20cc Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Tue, 17 Dec 2013 13:45:00 -0500 Subject: [PATCH 03/17] Bug 950014 - [Australis] Ctrl-K no longer goes to home page of default search engine (when search toolbar hidden). r=mconley,gijs --HG-- extra : rebase_source : 011ff25a2a6ed81e93c45f041ead35d5cf2be82b --- browser/base/content/browser.js | 8 +++---- .../test/browser_901207_searchbar_in_panel.js | 24 +++++++++++++++++++ 2 files changed, 27 insertions(+), 5 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 827a5f60438..60de9b5da94 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -2950,13 +2950,11 @@ const BrowserSearch = { openSearchPageIfFieldIsNotActive(searchBar); }; if (placement && placement.area == CustomizableUI.AREA_PANEL) { - PanelUI.show().then(() => { - // The panel is not constructed until the first time it is shown. - focusSearchBar(); - }); + // The panel is not constructed until the first time it is shown. + PanelUI.show().then(focusSearchBar); return; } - if (placement.area == CustomizableUI.AREA_NAVBAR && searchBar && + if (placement && placement.area == CustomizableUI.AREA_NAVBAR && searchBar && searchBar.parentNode.classList.contains("overflowedItem")) { let navBar = document.getElementById(CustomizableUI.AREA_NAVBAR); navBar.overflowable.show().then(() => { diff --git a/browser/components/customizableui/test/browser_901207_searchbar_in_panel.js b/browser/components/customizableui/test/browser_901207_searchbar_in_panel.js index b16d214c6d6..f32511c154b 100644 --- a/browser/components/customizableui/test/browser_901207_searchbar_in_panel.js +++ b/browser/components/customizableui/test/browser_901207_searchbar_in_panel.js @@ -86,6 +86,30 @@ add_task(function() { is(document.activeElement, searchbar.textbox.inputField, "The searchbar should be focused"); }); +// Ctrl+K should open the search page if the search bar has been customized out. +add_task(function() { + this.originalOpenUILinkIn = openUILinkIn; + try { + CustomizableUI.removeWidgetFromArea("search-container"); + let placement = CustomizableUI.getPlacementOfWidget("search-container"); + is(placement, null, "Search container should be in palette"); + + let openUILinkInCalled = false; + openUILinkIn = (aUrl, aWhichTab) => { + is(aUrl, Services.search.defaultEngine.searchForm, "Search page should be requested to open."); + is(aWhichTab, "current", "Should use the current tab for the search page."); + openUILinkInCalled = true; + }; + sendWebSearchKeyCommand(); + yield waitForCondition(function() openUILinkInCalled); + ok(openUILinkInCalled, "The search page should have been opened.") + } catch (e) { + ok(false, e); + } + openUILinkIn = this.originalOpenUILinkIn; + CustomizableUI.reset(); +}); + function sendWebSearchKeyCommand() { if (Services.appinfo.OS === "Darwin") EventUtils.synthesizeKey("k", { accelKey: true }); From a013500ed19eaffcb9df4d0641b4ba68c2c5f9f6 Mon Sep 17 00:00:00 2001 From: Jared Wein Date: Mon, 16 Dec 2013 23:20:13 -0500 Subject: [PATCH 04/17] Bug 885052 - [Australis] Fullscreen-button is checked during customization mode if the browser is in fullscreen. r=Unfocused --- .../customizableui/src/CustomizeMode.jsm | 9 +++++ .../customizableui/test/browser.ini | 1 + ...885052_customize_mode_observers_disabed.js | 39 +++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 browser/components/customizableui/test/browser_885052_customize_mode_observers_disabed.js diff --git a/browser/components/customizableui/src/CustomizeMode.jsm b/browser/components/customizableui/src/CustomizeMode.jsm index 4b4ba4c9d84..9cb9da6e95b 100644 --- a/browser/components/customizableui/src/CustomizeMode.jsm +++ b/browser/components/customizableui/src/CustomizeMode.jsm @@ -527,6 +527,11 @@ CustomizeMode.prototype = { aNode.removeAttribute("command"); } + if (aNode.hasAttribute("observes")) { + wrapper.setAttribute("itemobserves", aNode.getAttribute("observes")); + aNode.removeAttribute("observes"); + } + if (aNode.checked) { wrapper.setAttribute("itemchecked", "true"); aNode.checked = false; @@ -602,6 +607,10 @@ CustomizeMode.prototype = { return null; } + if (aWrapper.hasAttribute("itemobserves")) { + toolbarItem.setAttribute("observes", aWrapper.getAttribute("itemobserves")); + } + if (aWrapper.hasAttribute("itemchecked")) { toolbarItem.checked = true; } diff --git a/browser/components/customizableui/test/browser.ini b/browser/components/customizableui/test/browser.ini index 8db2b457a2e..3a7dfad508b 100644 --- a/browser/components/customizableui/test/browser.ini +++ b/browser/components/customizableui/test/browser.ini @@ -11,6 +11,7 @@ support-files = [browser_878452_drag_to_panel.js] [browser_880164_customization_context_menus.js] [browser_880382_drag_wide_widgets_in_panel.js] +[browser_885052_customize_mode_observers_disabed.js] [browser_885530_showInPrivateBrowsing.js] [browser_886323_buildArea_removable_nodes.js] [browser_887438_currentset_shim.js] diff --git a/browser/components/customizableui/test/browser_885052_customize_mode_observers_disabed.js b/browser/components/customizableui/test/browser_885052_customize_mode_observers_disabed.js new file mode 100644 index 00000000000..41faa7d9cac --- /dev/null +++ b/browser/components/customizableui/test/browser_885052_customize_mode_observers_disabed.js @@ -0,0 +1,39 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +"use strict"; + +// Observers should be disabled when in customization mode. +add_task(function() { + // Open and close the panel to make sure that the + // area is generated before getting a child of the area. + let shownPanelPromise = promisePanelShown(window); + PanelUI.toggle({type: "command"}); + yield shownPanelPromise; + let hiddenPanelPromise = promisePanelHidden(window); + PanelUI.toggle({type: "command"}); + yield hiddenPanelPromise; + + let fullscreenButton = document.getElementById("fullscreen-button"); + ok(!fullscreenButton.checked, "Fullscreen button should not be checked when not in fullscreen.") + + BrowserFullScreen(); + yield waitForCondition(function() fullscreenButton.checked); + ok(fullscreenButton.checked, "Fullscreen button should be checked when in fullscreen.") + + yield startCustomizing(); + + let fullscreenButtonWrapper = document.getElementById("wrapper-fullscreen-button"); + ok(fullscreenButtonWrapper.hasAttribute("itemobserves"), "Observer should be moved to wrapper"); + fullscreenButton = document.getElementById("fullscreen-button"); + ok(!fullscreenButton.hasAttribute("observes"), "Observer should be removed from button"); + ok(!fullscreenButton.checked, "Fullscreen button should no longer be checked during customization mode"); + + yield endCustomizing(); + + BrowserFullScreen(); + fullscreenButton = document.getElementById("fullscreen-button"); + yield waitForCondition(function() !fullscreenButton.checked); + ok(!fullscreenButton.checked, "Fullscreen button should not be checked when not in fullscreen.") +}); From 1f02646feaf4220a5a50954195f894cbb37d80d5 Mon Sep 17 00:00:00 2001 From: Justin Dolske Date: Mon, 16 Dec 2013 13:27:47 -0800 Subject: [PATCH 05/17] Bug 946549 - Remove dead code obsoleted by bug 355063 for filling passwords on load. r=MattN --- browser/base/content/content.js | 3 - .../base/content/contenthandlers/Content.js | 1 - mobile/android/chrome/content/browser.js | 2 - modules/libpref/src/init/all.js | 1 - .../passwordmgr/LoginManagerContent.jsm | 111 ------------------ .../components/passwordmgr/test/mochitest.ini | 3 - .../test/test_basic_form_pwevent.html | 20 ++-- .../passwordmgr/test/test_maxforms_1.html | 64 ---------- .../passwordmgr/test/test_maxforms_2.html | 64 ---------- .../passwordmgr/test/test_maxforms_3.html | 64 ---------- 10 files changed, 8 insertions(+), 325 deletions(-) delete mode 100644 toolkit/components/passwordmgr/test/test_maxforms_1.html delete mode 100644 toolkit/components/passwordmgr/test/test_maxforms_2.html delete mode 100644 toolkit/components/passwordmgr/test/test_maxforms_3.html diff --git a/browser/base/content/content.js b/browser/base/content/content.js index a3ac1bdee42..98499e06a31 100644 --- a/browser/base/content/content.js +++ b/browser/base/content/content.js @@ -38,9 +38,6 @@ if (Services.prefs.getBoolPref("browser.tabs.remote")) { sendAsyncMessage("contextmenu", {}, { event: event }); }, false); } else { - addEventListener("DOMContentLoaded", function(event) { - LoginManagerContent.onContentLoaded(event); - }); addEventListener("DOMFormHasPassword", function(event) { InsecurePasswordUtils.checkForInsecurePasswords(event.target); LoginManagerContent.onFormPassword(event); diff --git a/browser/metro/base/content/contenthandlers/Content.js b/browser/metro/base/content/contenthandlers/Content.js index b7692b1a40b..f7f5b718668 100644 --- a/browser/metro/base/content/contenthandlers/Content.js +++ b/browser/metro/base/content/contenthandlers/Content.js @@ -199,7 +199,6 @@ let Content = { break; case "DOMContentLoaded": - LoginManagerContent.onContentLoaded(aEvent); this._maybeNotifyErrorPage(); break; diff --git a/mobile/android/chrome/content/browser.js b/mobile/android/chrome/content/browser.js index a12975b033e..a38e1bdbc0f 100644 --- a/mobile/android/chrome/content/browser.js +++ b/mobile/android/chrome/content/browser.js @@ -3368,8 +3368,6 @@ Tab.prototype = { case "DOMContentLoaded": { let target = aEvent.originalTarget; - LoginManagerContent.onContentLoaded(aEvent); - // ignore on frames and other documents if (target != this.browser.contentDocument) return; diff --git a/modules/libpref/src/init/all.js b/modules/libpref/src/init/all.js index bc7e5511bef..56336376fbf 100644 --- a/modules/libpref/src/init/all.js +++ b/modules/libpref/src/init/all.js @@ -3897,7 +3897,6 @@ pref("signon.rememberSignons", true); pref("signon.autofillForms", true); pref("signon.autologin.proxy", false); pref("signon.debug", false); -pref("signon.useDOMFormHasPassword", true); // Satchel (Form Manager) prefs pref("browser.formfill.debug", false); diff --git a/toolkit/components/passwordmgr/LoginManagerContent.jsm b/toolkit/components/passwordmgr/LoginManagerContent.jsm index f22bacf9bee..50ac2b42ca0 100644 --- a/toolkit/components/passwordmgr/LoginManagerContent.jsm +++ b/toolkit/components/passwordmgr/LoginManagerContent.jsm @@ -14,7 +14,6 @@ Cu.import("resource://gre/modules/Services.jsm"); Cu.import("resource://gre/modules/PrivateBrowsingUtils.jsm"); var gEnabled = false, gDebug = false, gAutofillForms = true; // these mirror signon.* prefs -var gUseDOMFormHasPassword = false; // use DOMFormHasPassword event for autofill function log(...pieces) { function generateLogMessage(args) { @@ -72,7 +71,6 @@ var observer = { gDebug = Services.prefs.getBoolPref("signon.debug"); gEnabled = Services.prefs.getBoolPref("signon.rememberSignons"); gAutofillForms = Services.prefs.getBoolPref("signon.autofillForms"); - gUseDOMFormHasPassword = Services.prefs.getBoolPref("signon.useDOMFormHasPassword"); }, }; @@ -94,32 +92,8 @@ var LoginManagerContent = { return this.__formFillService; }, - onContentLoaded : function (event) { - // If we're using the new DOMFormHasPassword event, don't fill at pageload. - if (gUseDOMFormHasPassword) - return; - - if (!event.isTrusted) - return; - - if (!gEnabled) - return; - - let domDoc = event.target; - - // Only process things which might have HTML forms. - if (!(domDoc instanceof Ci.nsIDOMHTMLDocument)) - return; - - this._fillDocument(domDoc); - }, - onFormPassword: function (event) { - // If we're not using the new DOMFormHasPassword event, only fill at pageload. - if (!gUseDOMFormHasPassword) - return; - if (!event.isTrusted) return; @@ -552,91 +526,6 @@ var LoginManagerContent = { }, - /* - * _fillDocument - * - * Called when a page has loaded. For each form in the document, - * we check to see if it can be filled with a stored login. - */ - _fillDocument : function (doc) { - var forms = doc.forms; - if (!forms || forms.length == 0) - return; - - var formOrigin = LoginUtils._getPasswordOrigin(doc.documentURI); - - // If there are no logins for this site, bail out now. - if (!Services.logins.countLogins(formOrigin, "", null)) - return; - - // If we're currently displaying a master password prompt, defer - // processing this document until the user handles the prompt. - if (Services.logins.uiBusy) { - log("deferring fillDoc for", doc.documentURI); - let self = this; - let observer = { - QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]), - - observe: function (subject, topic, data) { - log("Got deferred fillDoc notification:", topic); - // Only run observer once. - Services.obs.removeObserver(this, "passwordmgr-crypto-login"); - Services.obs.removeObserver(this, "passwordmgr-crypto-loginCanceled"); - if (topic == "passwordmgr-crypto-loginCanceled") - return; - self._fillDocument(doc); - }, - handleEvent : function (event) { - // Not expected to be called - } - }; - // Trickyness follows: We want an observer, but don't want it to - // cause leaks. So add the observer with a weak reference, and use - // a dummy event listener (a strong reference) to keep it alive - // until the document is destroyed. - Services.obs.addObserver(observer, "passwordmgr-crypto-login", true); - Services.obs.addObserver(observer, "passwordmgr-crypto-loginCanceled", true); - doc.addEventListener("mozCleverClosureHack", observer); - return; - } - - log("fillDocument processing", forms.length, "forms on", doc.documentURI); - - var autofillForm = gAutofillForms && !PrivateBrowsingUtils.isWindowPrivate(doc.defaultView); - var previousActionOrigin = null; - var foundLogins = null; - - // Limit the number of forms we try to fill. If there are too many - // forms, just fill some at the beginning and end of the page. - const MAX_FORMS = 40; // assumed to be an even number - var skip_from = -1, skip_to = -1; - if (forms.length > MAX_FORMS) { - log("fillDocument limiting number of forms filled to", MAX_FORMS); - let chunk_size = MAX_FORMS / 2; - skip_from = chunk_size; - skip_to = forms.length - chunk_size; - } - - for (var i = 0; i < forms.length; i++) { - // Skip some in the middle of the document if there were too many. - if (i == skip_from) - i = skip_to; - - var form = forms[i]; - - // Only the actionOrigin might be changing, so if it's the same - // as the last form on the page we can reuse the same logins. - var actionOrigin = LoginUtils._getActionOrigin(form); - if (actionOrigin != previousActionOrigin) { - foundLogins = null; - previousActionOrigin = actionOrigin; - } - log("_fillDocument processing form[", i, "]"); - foundLogins = this._fillForm(form, autofillForm, false, false, foundLogins)[1]; - } // foreach form - }, - - /* * _fillform * diff --git a/toolkit/components/passwordmgr/test/mochitest.ini b/toolkit/components/passwordmgr/test/mochitest.ini index 1fdcba64748..72c8d078cad 100644 --- a/toolkit/components/passwordmgr/test/mochitest.ini +++ b/toolkit/components/passwordmgr/test/mochitest.ini @@ -54,9 +54,6 @@ support-files = # Bug 917797 - too many intermittent failures skip-if = true [test_master_password_cleanup.html] -[test_maxforms_1.html] -[test_maxforms_2.html] -[test_maxforms_3.html] [test_notifications.html] [test_notifications_popup.html] skip-if = os == "linux" # bug 934057 diff --git a/toolkit/components/passwordmgr/test/test_basic_form_pwevent.html b/toolkit/components/passwordmgr/test/test_basic_form_pwevent.html index 611945cb978..e0b51f2e53c 100644 --- a/toolkit/components/passwordmgr/test/test_basic_form_pwevent.html +++ b/toolkit/components/passwordmgr/test/test_basic_form_pwevent.html @@ -34,19 +34,15 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=355063 SimpleTest.finish(); } - if (SpecialPowers.getBoolPref("signon.useDOMFormHasPassword")) { - commonInit(); + commonInit(); - // Password Manager's own listener should always have been added first, so - // the test's listener should be called after the pwmgr's listener fills in - // a login. - // - SpecialPowers.addChromeEventListener("DOMFormHasPassword", checkForm); - window.addEventListener("load", startTest); - SimpleTest.waitForExplicitFinish(); - } else { - ok(true, "Skipping test when useDOMFormHasPassword is disabled"); - } + // Password Manager's own listener should always have been added first, so + // the test's listener should be called after the pwmgr's listener fills in + // a login. + // + SpecialPowers.addChromeEventListener("DOMFormHasPassword", checkForm); + window.addEventListener("load", startTest); + SimpleTest.waitForExplicitFinish(); diff --git a/toolkit/components/passwordmgr/test/test_maxforms_1.html b/toolkit/components/passwordmgr/test/test_maxforms_1.html deleted file mode 100644 index bcc2e29660c..00000000000 --- a/toolkit/components/passwordmgr/test/test_maxforms_1.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - Test for Login Manager - - - - - -Test limiting number of forms filled. - -

- - - - - -
-
-
- - diff --git a/toolkit/components/passwordmgr/test/test_maxforms_2.html b/toolkit/components/passwordmgr/test/test_maxforms_2.html deleted file mode 100644 index da315c42029..00000000000 --- a/toolkit/components/passwordmgr/test/test_maxforms_2.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - Test for Login Manager - - - - - -Test limiting number of forms filled. - -

- - - - - -
-
-
- - diff --git a/toolkit/components/passwordmgr/test/test_maxforms_3.html b/toolkit/components/passwordmgr/test/test_maxforms_3.html deleted file mode 100644 index 63d2bfedd49..00000000000 --- a/toolkit/components/passwordmgr/test/test_maxforms_3.html +++ /dev/null @@ -1,64 +0,0 @@ - - - - Test for Login Manager - - - - - -Test limiting number of forms filled. - -

- - - - - -
-
-
- - From 89188d1d52ab36db22502370e093a9e36335b438 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Tue, 17 Dec 2013 15:20:20 -0500 Subject: [PATCH 06/17] Bug 951256 - Add a GetGuid function with return value to APZC. r=Cwiiis --- gfx/layers/ipc/AsyncPanZoomController.cpp | 14 ++++++++------ gfx/layers/ipc/AsyncPanZoomController.h | 7 ++++++- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/gfx/layers/ipc/AsyncPanZoomController.cpp b/gfx/layers/ipc/AsyncPanZoomController.cpp index 4a8dc0349c7..cea4903ff0b 100644 --- a/gfx/layers/ipc/AsyncPanZoomController.cpp +++ b/gfx/layers/ipc/AsyncPanZoomController.cpp @@ -1693,17 +1693,19 @@ void AsyncPanZoomController::SendAsyncScrollEvent() { bool AsyncPanZoomController::Matches(const ScrollableLayerGuid& aGuid) { - return aGuid == ScrollableLayerGuid(mLayersId, mFrameMetrics); + return aGuid == GetGuid(); } void AsyncPanZoomController::GetGuid(ScrollableLayerGuid* aGuidOut) { - if (!aGuidOut) { - return; + if (aGuidOut) { + *aGuidOut = GetGuid(); } - aGuidOut->mLayersId = mLayersId; - aGuidOut->mScrollId = mFrameMetrics.mScrollId; - aGuidOut->mPresShellId = mFrameMetrics.mPresShellId; +} + +ScrollableLayerGuid AsyncPanZoomController::GetGuid() +{ + return ScrollableLayerGuid(mLayersId, mFrameMetrics); } } diff --git a/gfx/layers/ipc/AsyncPanZoomController.h b/gfx/layers/ipc/AsyncPanZoomController.h index 61164fab5f5..5c663c89a20 100644 --- a/gfx/layers/ipc/AsyncPanZoomController.h +++ b/gfx/layers/ipc/AsyncPanZoomController.h @@ -235,10 +235,15 @@ public: nsEventStatus HandleInputEvent(const InputData& aEvent); /** - * Populates the provided object with the scrollable guid of this apzc. + * Populates the provided object (if non-null) with the scrollable guid of this apzc. */ void GetGuid(ScrollableLayerGuid* aGuidOut); + /** + * Returns the scrollable guid of this apzc. + */ + ScrollableLayerGuid GetGuid(); + /** * Returns true if this APZC instance is for the layer identified by the guid. */ From d5750e38bca6347288f45a035f4dd6f348170a89 Mon Sep 17 00:00:00 2001 From: Kartikaya Gupta Date: Tue, 17 Dec 2013 15:20:21 -0500 Subject: [PATCH 07/17] Bug 951256 - Dump the APZC guid in rendertrace output. r=Cwiiis --- gfx/layers/ipc/AsyncPanZoomController.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/gfx/layers/ipc/AsyncPanZoomController.cpp b/gfx/layers/ipc/AsyncPanZoomController.cpp index cea4903ff0b..0e743f228d8 100644 --- a/gfx/layers/ipc/AsyncPanZoomController.cpp +++ b/gfx/layers/ipc/AsyncPanZoomController.cpp @@ -258,12 +258,13 @@ static bool IsCloseToVertical(float aAngle, float aThreshold) return (fabs(aAngle - (M_PI / 2)) < aThreshold); } -static inline void LogRendertraceRect(const char* aDesc, const char* aColor, const CSSRect& aRect) +static inline void LogRendertraceRect(const ScrollableLayerGuid& aGuid, const char* aDesc, const char* aColor, const CSSRect& aRect) { #ifdef APZC_ENABLE_RENDERTRACE static const TimeStamp sRenderStart = TimeStamp::Now(); TimeDuration delta = TimeStamp::Now() - sRenderStart; - printf_stderr("%s RENDERTRACE %f rect %s %f %f %f %f\n", + printf_stderr("(%llu,%lu,%llu)%s RENDERTRACE %f rect %s %f %f %f %f\n", + aGuid.mLayersId, aGuid.mPresShellId, aGuid.mScrollId, aDesc, delta.ToMilliseconds(), aColor, aRect.x, aRect.y, aRect.width, aRect.height); #endif @@ -1264,7 +1265,7 @@ AsyncPanZoomController::ScheduleContentRepaint(FrameMetrics &aFrameMetrics) { if (controller) { APZC_LOG_FM(aFrameMetrics, "%p requesting content repaint", this); - LogRendertraceRect("requested displayport", "yellow", + LogRendertraceRect(GetGuid(), "requested displayport", "yellow", aFrameMetrics.mDisplayPort + aFrameMetrics.mScrollOffset); mPaintThrottler.PostTask( @@ -1355,7 +1356,7 @@ bool AsyncPanZoomController::SampleContentTransformForFrame(const TimeStamp& aSa aScrollOffset = mFrameMetrics.mScrollOffset * mFrameMetrics.mZoom; *aNewTransform = GetCurrentAsyncTransform(); - LogRendertraceRect("viewport", "red", + LogRendertraceRect(GetGuid(), "viewport", "red", CSSRect(mFrameMetrics.mScrollOffset, ScreenSize(mFrameMetrics.mCompositionBounds.Size()) / mFrameMetrics.mZoom)); @@ -1424,8 +1425,8 @@ void AsyncPanZoomController::NotifyLayersUpdated(const FrameMetrics& aLayerMetri mFrameMetrics.mMayHaveTouchListeners = aLayerMetrics.mMayHaveTouchListeners; APZC_LOG_FM(aLayerMetrics, "%p got a NotifyLayersUpdated with aIsFirstPaint=%d", this, aIsFirstPaint); - LogRendertraceRect("page", "brown", aLayerMetrics.mScrollableRect); - LogRendertraceRect("painted displayport", "green", + LogRendertraceRect(GetGuid(), "page", "brown", aLayerMetrics.mScrollableRect); + LogRendertraceRect(GetGuid(), "painted displayport", "green", aLayerMetrics.mDisplayPort + aLayerMetrics.mScrollOffset); mPaintThrottler.TaskComplete(GetFrameTime()); From 0e933828ba5f2414772458964c0f36efef53eefc Mon Sep 17 00:00:00 2001 From: Matt Brubeck Date: Tue, 17 Dec 2013 12:50:49 -0800 Subject: [PATCH 08/17] Bug 950832 - Disable double-tap zoom and 300ms tap delay in Metro to fix OSK bugs [r=jimm] --- browser/metro/base/tests/mochitest/browser_apzc_basic.js | 2 ++ widget/windows/winrt/APZController.cpp | 8 -------- widget/windows/winrt/MetroInput.cpp | 6 +----- 3 files changed, 3 insertions(+), 13 deletions(-) diff --git a/browser/metro/base/tests/mochitest/browser_apzc_basic.js b/browser/metro/base/tests/mochitest/browser_apzc_basic.js index 8a49f105201..5e4a426b0e7 100644 --- a/browser/metro/base/tests/mochitest/browser_apzc_basic.js +++ b/browser/metro/base/tests/mochitest/browser_apzc_basic.js @@ -69,6 +69,7 @@ gTests.push({ } }); +/* Double-tap is disabled (bug 950832). gTests.push({ desc: "double tap transforms", setUp: setUp, @@ -93,6 +94,7 @@ gTests.push({ clearNativeTouchSequence(); } }); +*/ gTests.push({ desc: "scroll transforms", diff --git a/widget/windows/winrt/APZController.cpp b/widget/windows/winrt/APZController.cpp index bda3d791cbc..4d8518bfa87 100644 --- a/widget/windows/winrt/APZController.cpp +++ b/widget/windows/winrt/APZController.cpp @@ -235,19 +235,11 @@ APZController::RequestContentRepaint(const FrameMetrics& aFrameMetrics) void APZController::HandleDoubleTap(const CSSIntPoint& aPoint, int32_t aModifiers) { - NS_ConvertASCIItoUTF16 data( - nsPrintfCString("{ \"x\": %d, \"y\": %d, \"modifiers\": %d }", - (int32_t)aPoint.x, (int32_t)aPoint.y, aModifiers)); - MetroUtils::FireObserver("Gesture:DoubleTap", data.get()); } void APZController::HandleSingleTap(const CSSIntPoint& aPoint, int32_t aModifiers) { - NS_ConvertASCIItoUTF16 data( - nsPrintfCString("{ \"x\": %d, \"y\": %d, \"modifiers\": %d }", - (int32_t)aPoint.x, (int32_t)aPoint.y, aModifiers)); - MetroUtils::FireObserver("Gesture:SingleTap", data.get()); } void diff --git a/widget/windows/winrt/MetroInput.cpp b/widget/windows/winrt/MetroInput.cpp index d8e02ecabf1..8dfd45ffd55 100644 --- a/widget/windows/winrt/MetroInput.cpp +++ b/widget/windows/winrt/MetroInput.cpp @@ -962,11 +962,7 @@ MetroInput::HandleTap(const Foundation::Point& aPoint, unsigned int aTapCount) #endif LayoutDeviceIntPoint refPoint; - bool hitTestChrome = TransformRefPoint(aPoint, refPoint); - if (!hitTestChrome) { - // Let APZC handle tap/doubletap detection for content. - return; - } + TransformRefPoint(aPoint, refPoint); WidgetMouseEvent* mouseEvent = new WidgetMouseEvent(true, NS_MOUSE_MOVE, mWidget.Get(), From 144fea86a6ae665826b5fc9bfa486183a27679a6 Mon Sep 17 00:00:00 2001 From: Jim Mathies Date: Tue, 17 Dec 2013 15:13:33 -0600 Subject: [PATCH 09/17] Bug 944215 - Bring back the input logic in bug 950944, with some improvements. Increase the amount of time we process events, and message back once the input events we want delivered have been. r=bbondy --- widget/windows/winrt/MetroAppShell.cpp | 37 ++++++++++++++++++++++---- widget/windows/winrt/MetroAppShell.h | 1 + widget/windows/winrt/MetroInput.cpp | 16 +++++++---- 3 files changed, 44 insertions(+), 10 deletions(-) diff --git a/widget/windows/winrt/MetroAppShell.cpp b/widget/windows/winrt/MetroAppShell.cpp index 61af8d14561..9a0e53acd6a 100644 --- a/widget/windows/winrt/MetroAppShell.cpp +++ b/widget/windows/winrt/MetroAppShell.cpp @@ -27,6 +27,10 @@ using namespace ABI::Windows::Foundation; // ProcessNextNativeEvent message wait timeout, see bug 907410. #define MSG_WAIT_TIMEOUT 250 +// MetroInput will occasionally ask us to flush all input so that the dom is +// up to date. This is the maximum amount of time we'll agree to spend in +// NS_ProcessPendingEvents. +#define PURGE_MAX_TIMEOUT 50 namespace mozilla { namespace widget { @@ -43,7 +47,8 @@ extern UINT sAppShellGeckoMsgId; static ComPtr sCoreStatic; static bool sIsDispatching = false; -static bool sWillEmptyThreadQueue = false; +static bool sShouldPurgeThreadQueue = false; +static bool sBlockNativeEvents = false; MetroAppShell::~MetroAppShell() { @@ -245,7 +250,7 @@ MetroAppShell::Run(void) void // static MetroAppShell::MarkEventQueueForPurge() { - sWillEmptyThreadQueue = true; + sShouldPurgeThreadQueue = true; // If we're dispatching native events, wait until the dispatcher is // off the stack. @@ -257,19 +262,32 @@ MetroAppShell::MarkEventQueueForPurge() DispatchAllGeckoEvents(); } +// Notification from MetroInput that all events it wanted delivered +// have been dispatched. It is safe to start processing windowing +// events. +void // static +MetroAppShell::InputEventsDispatched() +{ + sBlockNativeEvents = false; +} + // static void MetroAppShell::DispatchAllGeckoEvents() { - if (!sWillEmptyThreadQueue) { + // Only do this if requested + if (!sShouldPurgeThreadQueue) { return; } NS_ASSERTION(NS_IsMainThread(), "DispatchAllGeckoEvents should be called on the main thread"); - sWillEmptyThreadQueue = false; + sShouldPurgeThreadQueue = false; + + sBlockNativeEvents = true; nsIThread *thread = NS_GetCurrentThread(); - NS_ProcessPendingEvents(thread, 0); + NS_ProcessPendingEvents(thread, PURGE_MAX_TIMEOUT); + sBlockNativeEvents = false; } static void @@ -317,6 +335,15 @@ MetroAppShell::ProcessOneNativeEventIfPresent() bool MetroAppShell::ProcessNextNativeEvent(bool mayWait) { + // NS_ProcessPendingEvents will process thread events *and* call + // nsBaseAppShell::OnProcessNextEvent to process native events. However + // we do not want native events getting dispatched while we are trying + // to dispatch pending input in DispatchAllGeckoEvents since a native + // event may be a UIA Automation call coming in to check focus. + if (sBlockNativeEvents) { + return false; + } + if (ProcessOneNativeEventIfPresent()) { return true; } diff --git a/widget/windows/winrt/MetroAppShell.h b/widget/windows/winrt/MetroAppShell.h index 1bb521ee303..b1bd7f55db1 100644 --- a/widget/windows/winrt/MetroAppShell.h +++ b/widget/windows/winrt/MetroAppShell.h @@ -28,6 +28,7 @@ public: static LRESULT CALLBACK EventWindowProc(HWND, UINT, WPARAM, LPARAM); static bool ProcessOneNativeEventIfPresent(); static void MarkEventQueueForPurge(); + static void InputEventsDispatched(); protected: NS_IMETHOD Run(); diff --git a/widget/windows/winrt/MetroInput.cpp b/widget/windows/winrt/MetroInput.cpp index 8dfd45ffd55..fb6fb27a27c 100644 --- a/widget/windows/winrt/MetroInput.cpp +++ b/widget/windows/winrt/MetroInput.cpp @@ -653,11 +653,6 @@ MetroInput::OnPointerReleased(UI::Core::ICoreWindow* aSender, mGestureRecognizer->ProcessUpEvent(currentPoint.Get()); } - // Make sure all gecko events are dispatched and the dom is up to date - // so that when ui automation comes in looking for focus info it gets - // the right information. - MetroAppShell::MarkEventQueueForPurge(); - return S_OK; } @@ -989,6 +984,11 @@ MetroInput::HandleTap(const Foundation::Point& aPoint, unsigned int aTapCount) mouseEvent->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH; mouseEvent->button = WidgetMouseEvent::buttonType::eLeftButton; DispatchAsyncEventIgnoreStatus(mouseEvent); + + // Make sure all gecko events are dispatched and the dom is up to date + // so that when ui automation comes in looking for focus info it gets + // the right information. + MetroAppShell::MarkEventQueueForPurge(); } void @@ -1033,6 +1033,12 @@ MetroInput::DeliverNextQueuedEventIgnoreStatus() MOZ_ASSERT(event.get()); DispatchEventIgnoreStatus(event.get()); + // Let app shell know we've delivered that last input we wanted purged + // via a call to MarkEventQueueForPurge(). + if (event->message == NS_MOUSE_BUTTON_UP) { + MetroAppShell::InputEventsDispatched(); + } + // Clear :hover/:active states for mouse events generated by HandleTap WidgetMouseEvent* mouseEvent = event.get()->AsMouseEvent(); if (!mouseEvent) { From 19c320d2e53ec9765d09f9b5a2bf779ede061fda Mon Sep 17 00:00:00 2001 From: Jim Mathies Date: Tue, 17 Dec 2013 15:17:26 -0600 Subject: [PATCH 10/17] Bug 950241 - Fix: when the browser restarts for an update, a new instance doesn't launch. r=bbondy --- .../metro/shell/commandexecutehandler/CommandExecuteHandler.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browser/metro/shell/commandexecutehandler/CommandExecuteHandler.cpp b/browser/metro/shell/commandexecutehandler/CommandExecuteHandler.cpp index 32da7e5c463..86fb935b1ff 100644 --- a/browser/metro/shell/commandexecutehandler/CommandExecuteHandler.cpp +++ b/browser/metro/shell/commandexecutehandler/CommandExecuteHandler.cpp @@ -675,7 +675,7 @@ DelayedExecuteThread(LPVOID param) if (GetDefaultBrowserAppModelID(appModelID)) { Log(L"Activating application"); DWORD processID; - HRESULT hr = activateMgr->ActivateApplication(appModelID, L"", AO_NOSPLASHSCREEN, &processID); + HRESULT hr = activateMgr->ActivateApplication(appModelID, L"", AO_NOERRORUI, &processID); if (SUCCEEDED(hr)) { Log(L"Activate application succeeded"); } else { From 76814b4c2fdf7fbb46b630d6125afa5b4511899e Mon Sep 17 00:00:00 2001 From: Justin Dolske Date: Tue, 17 Dec 2013 13:21:37 -0800 Subject: [PATCH 11/17] Bug 951364 - [Australis] button context menu should offer to "move", not "add". r=jaws --- browser/base/content/browser.js | 10 +++++----- browser/base/content/browser.xul | 4 ++-- .../customizableui/content/panelUI.inc.xul | 6 +++--- .../browser_880164_customization_context_menus.js | 14 +++++++------- browser/locales/en-US/chrome/browser/browser.dtd | 4 ++++ 5 files changed, 21 insertions(+), 17 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 60de9b5da94..5beac53e6d5 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -4257,10 +4257,10 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) { } - let addToPanel = popup.querySelector(".customize-context-addToPanel"); + let moveToPanel = popup.querySelector(".customize-context-moveToPanel"); let removeFromToolbar = popup.querySelector(".customize-context-removeFromToolbar"); - // View -> Toolbars menu doesn't have the addToPanel or removeFromToolbar items. - if (!addToPanel || !removeFromToolbar) { + // View -> Toolbars menu doesn't have the moveToPanel or removeFromToolbar items. + if (!moveToPanel || !removeFromToolbar) { return; } @@ -4287,10 +4287,10 @@ function onViewToolbarsPopupShowing(aEvent, aInsertPoint) { let movable = toolbarItem && toolbarItem.parentNode && CustomizableUI.isWidgetRemovable(toolbarItem); if (movable) { - addToPanel.removeAttribute("disabled"); + moveToPanel.removeAttribute("disabled"); removeFromToolbar.removeAttribute("disabled"); } else { - addToPanel.setAttribute("disabled", true); + moveToPanel.setAttribute("disabled", true); removeFromToolbar.setAttribute("disabled", true); } } diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 4dab60e2f0b..3d8376fe13c 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -246,8 +246,8 @@ onpopupshowing="onViewToolbarsPopupShowing(event, document.getElementById('viewToolbarsMenuSeparator'));"> + label="&customizeMenu.moveToPanel.label;" + class="customize-context-moveToPanel"/> + class="customize-context-moveToToolbar" + accesskey="&customizeMenu.moveToToolbar.accesskey;" + label="&customizeMenu.moveToToolbar.label;"/> + + + + From 615660f8267640533dd8a5c79e6bc1e8bc4a583e Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Tue, 17 Dec 2013 13:34:10 -0800 Subject: [PATCH 12/17] Bug 949181 - Get rid of the Page enum in HomePager. r=wesj --- mobile/android/base/BrowserApp.java | 10 ++--- mobile/android/base/Tab.java | 21 +++++---- mobile/android/base/Tabs.java | 4 +- mobile/android/base/home/HomeAdapter.java | 21 +++------ mobile/android/base/home/HomeConfig.java | 21 --------- mobile/android/base/home/HomePager.java | 53 +++++------------------ 6 files changed, 34 insertions(+), 96 deletions(-) diff --git a/mobile/android/base/BrowserApp.java b/mobile/android/base/BrowserApp.java index aaa27a068a5..04c65b93a7a 100644 --- a/mobile/android/base/BrowserApp.java +++ b/mobile/android/base/BrowserApp.java @@ -1607,7 +1607,7 @@ abstract public class BrowserApp extends GeckoApp } if (isAboutHome(tab)) { - showHomePager(tab.getAboutHomePage()); + showHomePager(tab.getAboutHomePageId()); if (isDynamicToolbarEnabled()) { // Show the toolbar. @@ -1632,8 +1632,8 @@ abstract public class BrowserApp extends GeckoApp } } - private void showHomePager(HomePager.Page page) { - showHomePagerWithAnimator(page, null); + private void showHomePager(String pageId) { + showHomePagerWithAnimator(pageId, null); } private void showHomePagerWithAnimator(PropertyAnimator animator) { @@ -1642,7 +1642,7 @@ abstract public class BrowserApp extends GeckoApp showHomePagerWithAnimator(null, animator); } - private void showHomePagerWithAnimator(HomePager.Page page, PropertyAnimator animator) { + private void showHomePagerWithAnimator(String pageId, PropertyAnimator animator) { if (isHomePagerVisible()) { return; } @@ -1663,7 +1663,7 @@ abstract public class BrowserApp extends GeckoApp mHomePager.show(getSupportLoaderManager(), getSupportFragmentManager(), - page, animator); + pageId, animator); // Hide the web content so it cannot be focused by screen readers. hideWebContentOnPropertyAnimationEnd(animator); diff --git a/mobile/android/base/Tab.java b/mobile/android/base/Tab.java index 0f1a02d10a7..74f71730eb4 100644 --- a/mobile/android/base/Tab.java +++ b/mobile/android/base/Tab.java @@ -8,7 +8,6 @@ package org.mozilla.gecko; import org.mozilla.gecko.SiteIdentity.SecurityMode; import org.mozilla.gecko.db.BrowserDB; import org.mozilla.gecko.gfx.Layer; -import org.mozilla.gecko.home.HomePager; import org.mozilla.gecko.util.ThreadUtils; import org.json.JSONException; @@ -52,7 +51,7 @@ public class Tab { private int mHistoryIndex; private int mHistorySize; private int mParentId; - private HomePager.Page mAboutHomePage; + private String mAboutHomePageId; private boolean mExternal; private boolean mBookmark; private boolean mReadingListItem; @@ -95,7 +94,7 @@ public class Tab { mUserSearch = ""; mExternal = external; mParentId = parentId; - mAboutHomePage = null; + mAboutHomePageId = null; mTitle = title == null ? "" : title; mFavicon = null; mFaviconUrl = null; @@ -147,12 +146,12 @@ public class Tab { return mParentId; } - public HomePager.Page getAboutHomePage() { - return mAboutHomePage; + public String getAboutHomePageId() { + return mAboutHomePageId; } - private void setAboutHomePage(HomePager.Page page) { - mAboutHomePage = page; + private void setAboutHomePageId(String pageId) { + mAboutHomePageId = pageId; } // may be null if user-entered query hasn't yet been resolved to a URI @@ -656,11 +655,11 @@ public class Tab { setBackgroundColor(DEFAULT_BACKGROUND_COLOR); setErrorType(ErrorType.NONE); - final String homePage = message.getString("aboutHomePage"); - if (!TextUtils.isEmpty(homePage)) { - setAboutHomePage(HomePager.Page.valueOf(homePage)); + final String homePageId = message.getString("aboutHomePage"); + if (!TextUtils.isEmpty(homePageId)) { + setAboutHomePageId(homePageId); } else { - setAboutHomePage(null); + setAboutHomePageId(null); } Tabs.getInstance().notifyListeners(this, Tabs.TabEvents.LOCATION_CHANGE, oldUrl); diff --git a/mobile/android/base/Tabs.java b/mobile/android/base/Tabs.java index dea9208b60b..b5c5d2cf983 100644 --- a/mobile/android/base/Tabs.java +++ b/mobile/android/base/Tabs.java @@ -7,7 +7,6 @@ package org.mozilla.gecko; import org.mozilla.gecko.db.BrowserDB; import org.mozilla.gecko.favicons.Favicons; -import org.mozilla.gecko.home.HomePager; import org.mozilla.gecko.mozglue.JNITarget; import org.mozilla.gecko.mozglue.RobocopTarget; import org.mozilla.gecko.sync.setup.SyncAccounts; @@ -724,7 +723,8 @@ public class Tabs implements GeckoEventListener { args.put("delayLoad", delayLoad); args.put("desktopMode", desktopMode); args.put("selected", !background); - args.put("aboutHomePage", (flags & LOADURL_READING_LIST) != 0 ? HomePager.Page.READING_LIST : ""); + // XXX: Dirty hack to pass reading list page id - let's get rid of this code path in bug 949178. + args.put("aboutHomePage", (flags & LOADURL_READING_LIST) != 0 ? "reading_list-reading_list" : ""); if ((flags & LOADURL_NEW_TAB) != 0) { int tabId = getNextTabId(); diff --git a/mobile/android/base/home/HomeAdapter.java b/mobile/android/base/home/HomeAdapter.java index db92fb7de29..d3c411cbc31 100644 --- a/mobile/android/base/home/HomeAdapter.java +++ b/mobile/android/base/home/HomeAdapter.java @@ -8,7 +8,6 @@ package org.mozilla.gecko.home; import org.mozilla.gecko.home.HomeConfig.PageEntry; import org.mozilla.gecko.home.HomeConfig.PageType; import org.mozilla.gecko.home.HomePager; -import org.mozilla.gecko.home.HomePager.Page; import android.content.Context; import android.os.Bundle; @@ -84,10 +83,10 @@ class HomeAdapter extends FragmentStatePagerAdapter { mAddPageListener = listener; } - public int getItemPosition(Page page) { + public int getItemPosition(String pageId) { for (int i = 0; i < mPageInfos.size(); i++) { - final Page infoPage = mPageInfos.get(i).toPage(); - if (infoPage == page) { + final String id = mPageInfos.get(i).getId(); + if (id.equals(pageId)) { return i; } } @@ -95,15 +94,14 @@ class HomeAdapter extends FragmentStatePagerAdapter { return -1; } - public Page getPageAtPosition(int position) { + public String getPageIdAtPosition(int position) { // getPageAtPosition() might be called before HomeAdapter // has got its initial list of PageEntries. Just bail. if (mPageInfos.isEmpty()) { return null; } - PageInfo info = mPageInfos.get(position); - return info.toPage(); + return mPageInfos.get(position).getId(); } private void addPage(PageInfo info) { @@ -178,14 +176,5 @@ class HomeAdapter extends FragmentStatePagerAdapter { return args; } - - public Page toPage() { - final PageType type = mPageEntry.getType(); - if (type == PageType.LIST) { - return null; - } - - return Page.valueOf(type); - } } } diff --git a/mobile/android/base/home/HomeConfig.java b/mobile/android/base/home/HomeConfig.java index 636fd617f7d..309bdee3472 100644 --- a/mobile/android/base/home/HomeConfig.java +++ b/mobile/android/base/home/HomeConfig.java @@ -5,8 +5,6 @@ package org.mozilla.gecko.home; -import org.mozilla.gecko.home.HomePager.Page; - import android.content.Context; import android.os.Parcel; import android.os.Parcelable; @@ -31,25 +29,6 @@ final class HomeConfig { mPageClass = pageClass; } - public static PageType valueOf(Page page) { - switch(page) { - case TOP_SITES: - return PageType.TOP_SITES; - - case BOOKMARKS: - return PageType.BOOKMARKS; - - case HISTORY: - return PageType.HISTORY; - - case READING_LIST: - return PageType.READING_LIST; - - default: - throw new IllegalArgumentException("Could not convert unrecognized Page"); - } - } - public static PageType fromId(String id) { if (id == null) { throw new IllegalArgumentException("Could not convert null String to PageType"); diff --git a/mobile/android/base/home/HomePager.java b/mobile/android/base/home/HomePager.java index 3e85eb2df75..f4ffe5be054 100644 --- a/mobile/android/base/home/HomePager.java +++ b/mobile/android/base/home/HomePager.java @@ -11,7 +11,6 @@ import org.mozilla.gecko.animation.ViewHelper; import org.mozilla.gecko.home.HomeAdapter.OnAddPageListener; import org.mozilla.gecko.home.HomeConfig.PageEntry; import org.mozilla.gecko.home.HomeConfig.PageType; -import org.mozilla.gecko.mozglue.RobocopTarget; import org.mozilla.gecko.util.HardwareUtils; import android.content.Context; @@ -46,35 +45,7 @@ public class HomePager extends ViewPager { private final HomeConfig mConfig; private ConfigLoaderCallbacks mConfigLoaderCallbacks; - private Page mInitialPage; - - // List of pages in order. - @RobocopTarget - public enum Page { - HISTORY, - TOP_SITES, - BOOKMARKS, - READING_LIST; - - static Page valueOf(PageType page) { - switch(page) { - case TOP_SITES: - return Page.TOP_SITES; - - case BOOKMARKS: - return Page.BOOKMARKS; - - case HISTORY: - return Page.HISTORY; - - case READING_LIST: - return Page.READING_LIST; - - default: - throw new IllegalArgumentException("Could not convert unrecognized PageType"); - } - } - } + private String mInitialPageId; // This is mostly used by UI tests to easily fetch // specific list views at runtime. @@ -186,17 +157,17 @@ public class HomePager extends ViewPager { public void redisplay(LoaderManager lm, FragmentManager fm) { final HomeAdapter adapter = (HomeAdapter) getAdapter(); - // If mInitialPage is non-null, this means the HomePager hasn't + // If mInitialPageId is non-null, this means the HomePager hasn't // finished loading its config yet. Simply re-show() with the // current target page. - final Page currentPage; - if (mInitialPage != null) { - currentPage = mInitialPage; + final String currentPageId; + if (mInitialPageId != null) { + currentPageId = mInitialPageId; } else { - currentPage = adapter.getPageAtPosition(getCurrentItem()); + currentPageId = adapter.getPageIdAtPosition(getCurrentItem()); } - show(lm, fm, currentPage, null); + show(lm, fm, currentPageId, null); } /** @@ -204,9 +175,9 @@ public class HomePager extends ViewPager { * * @param fm FragmentManager for the adapter */ - public void show(LoaderManager lm, FragmentManager fm, Page page, PropertyAnimator animator) { + public void show(LoaderManager lm, FragmentManager fm, String pageId, PropertyAnimator animator) { mLoaded = true; - mInitialPage = page; + mInitialPageId = pageId; // Only animate on post-HC devices, when a non-null animator is given final boolean shouldAnimate = (animator != null && Build.VERSION.SDK_INT >= 11); @@ -314,9 +285,9 @@ public class HomePager extends ViewPager { // Use the default page as defined in the HomePager's configuration // if the initial page wasn't explicitly set by the show() caller. - if (mInitialPage != null) { - setCurrentItem(adapter.getItemPosition(mInitialPage), false); - mInitialPage = null; + if (mInitialPageId != null) { + setCurrentItem(adapter.getItemPosition(mInitialPageId), false); + mInitialPageId = null; } else { for (int i = 0; i < count; i++) { final PageEntry pageEntry = pageEntries.get(i); From b3a6bd21a54a7c85aefc1625558d651e334548ac Mon Sep 17 00:00:00 2001 From: Margaret Leibovic Date: Tue, 17 Dec 2013 13:34:13 -0800 Subject: [PATCH 13/17] Bug 949181 - Update robocop tests to get rid of dependency on HomePager.Page. r=mcomella --- .../tests/components/AboutHomeComponent.java | 15 ++++++--- .../tests/testAboutHomePageNavigation.java | 32 +++++++++---------- .../base/tests/testAboutHomeVisibility.java | 8 ++--- 3 files changed, 31 insertions(+), 24 deletions(-) diff --git a/mobile/android/base/tests/components/AboutHomeComponent.java b/mobile/android/base/tests/components/AboutHomeComponent.java index 59a6be43e79..2ac70d24945 100644 --- a/mobile/android/base/tests/components/AboutHomeComponent.java +++ b/mobile/android/base/tests/components/AboutHomeComponent.java @@ -7,7 +7,6 @@ package org.mozilla.gecko.tests.components; import static org.mozilla.gecko.tests.helpers.AssertionHelper.*; import org.mozilla.gecko.Actions; -import org.mozilla.gecko.home.HomePager.Page; import org.mozilla.gecko.R; import org.mozilla.gecko.tests.helpers.*; import org.mozilla.gecko.tests.UITestContext; @@ -23,6 +22,14 @@ import android.view.View; * A class representing any interactions that take place on the Awesomescreen. */ public class AboutHomeComponent extends BaseComponent { + // The different types of pages that can be present on about:home + public enum PageType { + HISTORY, + TOP_SITES, + BOOKMARKS, + READING_LIST + } + // TODO: Having a specific ordering of pages is prone to fail and thus temporary. // Hopefully the work in bug 940565 will alleviate the need for these enums. // Explicit ordering of HomePager pages on a phone. @@ -53,7 +60,7 @@ public class AboutHomeComponent extends BaseComponent { return (ViewPager) mSolo.getView(R.id.home_pager); } - public AboutHomeComponent assertCurrentPage(final Page expectedPage) { + public AboutHomeComponent assertCurrentPage(final PageType expectedPage) { assertVisible(); final int expectedPageIndex = getPageIndexForDevice(expectedPage.ordinal()); @@ -123,10 +130,10 @@ public class AboutHomeComponent extends BaseComponent { /** * Gets the page index in the device specific Page enum for the given index in the - * HomePager.Page enum. + * PageType enum. */ private int getPageIndexForDevice(final int pageIndex) { - final String pageName = Page.values()[pageIndex].name(); + final String pageName = PageType.values()[pageIndex].name(); final Class devicePageEnum = DeviceHelper.isTablet() ? TabletPage.class : PhonePage.class; return Enum.valueOf(devicePageEnum, pageName).ordinal(); diff --git a/mobile/android/base/tests/testAboutHomePageNavigation.java b/mobile/android/base/tests/testAboutHomePageNavigation.java index e42f4f4fa0d..d9cf7b11e6f 100644 --- a/mobile/android/base/tests/testAboutHomePageNavigation.java +++ b/mobile/android/base/tests/testAboutHomePageNavigation.java @@ -2,7 +2,7 @@ package org.mozilla.gecko.tests; import static org.mozilla.gecko.tests.helpers.AssertionHelper.*; -import org.mozilla.gecko.home.HomePager.Page; +import org.mozilla.gecko.tests.components.AboutHomeComponent.PageType; import org.mozilla.gecko.tests.helpers.*; /** @@ -16,13 +16,13 @@ public class testAboutHomePageNavigation extends UITest { GeckoHelper.blockForReady(); mAboutHome.assertVisible() - .assertCurrentPage(Page.TOP_SITES); + .assertCurrentPage(PageType.TOP_SITES); mAboutHome.swipeToPageOnRight(); - mAboutHome.assertCurrentPage(Page.BOOKMARKS); + mAboutHome.assertCurrentPage(PageType.BOOKMARKS); mAboutHome.swipeToPageOnRight(); - mAboutHome.assertCurrentPage(Page.READING_LIST); + mAboutHome.assertCurrentPage(PageType.READING_LIST); // Ideally these helpers would just be their own tests. However, by keeping this within // one method, we're saving test setUp and tearDown resources. @@ -35,46 +35,46 @@ public class testAboutHomePageNavigation extends UITest { private void helperTestTablet() { mAboutHome.swipeToPageOnRight(); - mAboutHome.assertCurrentPage(Page.HISTORY); + mAboutHome.assertCurrentPage(PageType.HISTORY); // Edge case. mAboutHome.swipeToPageOnRight(); - mAboutHome.assertCurrentPage(Page.HISTORY); + mAboutHome.assertCurrentPage(PageType.HISTORY); mAboutHome.swipeToPageOnLeft(); - mAboutHome.assertCurrentPage(Page.READING_LIST); + mAboutHome.assertCurrentPage(PageType.READING_LIST); mAboutHome.swipeToPageOnLeft(); - mAboutHome.assertCurrentPage(Page.BOOKMARKS); + mAboutHome.assertCurrentPage(PageType.BOOKMARKS); mAboutHome.swipeToPageOnLeft(); - mAboutHome.assertCurrentPage(Page.TOP_SITES); + mAboutHome.assertCurrentPage(PageType.TOP_SITES); // Edge case. mAboutHome.swipeToPageOnLeft(); - mAboutHome.assertCurrentPage(Page.TOP_SITES); + mAboutHome.assertCurrentPage(PageType.TOP_SITES); } private void helperTestPhone() { // Edge case. mAboutHome.swipeToPageOnRight(); - mAboutHome.assertCurrentPage(Page.READING_LIST); + mAboutHome.assertCurrentPage(PageType.READING_LIST); mAboutHome.swipeToPageOnLeft(); - mAboutHome.assertCurrentPage(Page.BOOKMARKS); + mAboutHome.assertCurrentPage(PageType.BOOKMARKS); mAboutHome.swipeToPageOnLeft(); - mAboutHome.assertCurrentPage(Page.TOP_SITES); + mAboutHome.assertCurrentPage(PageType.TOP_SITES); mAboutHome.swipeToPageOnLeft(); - mAboutHome.assertCurrentPage(Page.HISTORY); + mAboutHome.assertCurrentPage(PageType.HISTORY); // Edge case. mAboutHome.swipeToPageOnLeft(); - mAboutHome.assertCurrentPage(Page.HISTORY); + mAboutHome.assertCurrentPage(PageType.HISTORY); mAboutHome.swipeToPageOnRight(); - mAboutHome.assertCurrentPage(Page.TOP_SITES); + mAboutHome.assertCurrentPage(PageType.TOP_SITES); } // TODO: bug 943706 - reimplement this old test code. diff --git a/mobile/android/base/tests/testAboutHomeVisibility.java b/mobile/android/base/tests/testAboutHomeVisibility.java index 8c8c4620343..44291f231e5 100644 --- a/mobile/android/base/tests/testAboutHomeVisibility.java +++ b/mobile/android/base/tests/testAboutHomeVisibility.java @@ -2,7 +2,7 @@ package org.mozilla.gecko.tests; import static org.mozilla.gecko.tests.helpers.AssertionHelper.*; -import org.mozilla.gecko.home.HomePager.Page; +import org.mozilla.gecko.tests.components.AboutHomeComponent.PageType; import org.mozilla.gecko.tests.helpers.*; /** @@ -15,7 +15,7 @@ public class testAboutHomeVisibility extends UITest { // Check initial state on about:home. mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE); mAboutHome.assertVisible() - .assertCurrentPage(Page.TOP_SITES); + .assertCurrentPage(PageType.TOP_SITES); // Go to blank 01. NavigationHelper.enterAndLoadUrl(StringHelper.ROBOCOP_BLANK_PAGE_01_URL); @@ -30,7 +30,7 @@ public class testAboutHomeVisibility extends UITest { // Enter editing mode, where the about:home UI should be visible. mToolbar.enterEditingMode(); mAboutHome.assertVisible() - .assertCurrentPage(Page.TOP_SITES); + .assertCurrentPage(PageType.TOP_SITES); // Dismiss editing mode, where the about:home UI should be gone. mToolbar.dismissEditingMode(); @@ -40,7 +40,7 @@ public class testAboutHomeVisibility extends UITest { NavigationHelper.enterAndLoadUrl(StringHelper.ABOUT_HOME_URL); mToolbar.assertTitle(StringHelper.ABOUT_HOME_TITLE); mAboutHome.assertVisible() - .assertCurrentPage(Page.TOP_SITES); + .assertCurrentPage(PageType.TOP_SITES); // TODO: Type in a url and assert the go button is visible. } From f622886467f376e41fca12bde1ab9698d71e8560 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 17 Dec 2013 13:45:26 -0800 Subject: [PATCH 14/17] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump ======== https://hg.mozilla.org/integration/gaia-central/rev/d12b645e3b8b Author: Ryan VanderMeulen Desc: Merge pull request #14779 from mvines/bug950809 Bug 950809 - Add null check for e.accelerationIncludingGravity. r=johnhu ======== https://hg.mozilla.org/integration/gaia-central/rev/d6423ca5d324 Author: Michael Vines Desc: Bug 950809 - Add null check for e.accelerationIncludingGravity. r=johnhu --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 93f659b6395..c37462c22eb 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "9919e96678a4fc08ffe6ca9068bfc245394fa5e3", + "revision": "d12b645e3b8b60cf020f0c0c6ef3bb74fc71c9d2", "repo_path": "/integration/gaia-central" } From 7edac9928b8b14023c10455e242778aa33351c2b Mon Sep 17 00:00:00 2001 From: Mike Conley Date: Tue, 17 Dec 2013 17:00:13 -0500 Subject: [PATCH 15/17] Bug 944049 - [Australis] Collect UITelemetry on bookmarks toolbar usage. r=jaws. --- browser/modules/BrowserUITelemetry.jsm | 55 ++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/browser/modules/BrowserUITelemetry.jsm b/browser/modules/BrowserUITelemetry.jsm index a419e56b1cd..352a62a7854 100644 --- a/browser/modules/BrowserUITelemetry.jsm +++ b/browser/modules/BrowserUITelemetry.jsm @@ -23,6 +23,11 @@ const ALL_BUILTIN_ITEMS = [ "switch-to-metro-button", ]; +const OTHER_MOUSEUP_MONITORED_ITEMS = [ + "PlacesChevron", + "PlacesToolbarItems", +]; + this.BrowserUITelemetry = { init: function() { UITelemetry.addSimpleMeasureFunction("toolbars", @@ -106,6 +111,13 @@ this.BrowserUITelemetry = { (areaNode.customizationTarget || areaNode).addEventListener("mouseup", this); } } + + for (let itemID of OTHER_MOUSEUP_MONITORED_ITEMS) { + let item = document.getElementById(itemID); + if (item) { + item.addEventListener("mouseup", this); + } + } }, _unregisterWindow: function(aWindow) { @@ -118,6 +130,13 @@ this.BrowserUITelemetry = { (areaNode.customizationTarget || areaNode).removeEventListener("mouseup", this); } } + + for (let itemID of OTHER_MOUSEUP_MONITORED_ITEMS) { + let item = document.getElementById(itemID); + if (item) { + item.removeEventListener("mouseup", this); + } + } }, handleEvent: function(aEvent) { @@ -132,6 +151,38 @@ this.BrowserUITelemetry = { }, _handleMouseUp: function(aEvent) { + let targetID = aEvent.currentTarget.id; + + switch (targetID) { + case "PlacesToolbarItems": + this._PlacesToolbarItemsMouseUp(aEvent); + break; + case "PlacesChevron": + this._PlacesChevronMouseUp(aEvent); + break; + default: + this._checkForBuiltinItem(aEvent); + } + }, + + _PlacesChevronMouseUp: function(aEvent) { + let target = aEvent.originalTarget; + let result = target.id == "PlacesChevron" ? "chevron" : "overflowed-item"; + this._countMouseUpEvent("click-bookmarks-bar", result, aEvent.button); + }, + + _PlacesToolbarItemsMouseUp: function(aEvent) { + let target = aEvent.originalTarget; + // If this isn't a bookmark-item, we don't care about it. + if (!target.classList.contains("bookmark-item")) { + return; + } + + let result = target.hasAttribute("container") ? "container" : "item"; + this._countMouseUpEvent("click-bookmarks-bar", result, aEvent.button); + }, + + _checkForBuiltinItem: function(aEvent) { let item = aEvent.originalTarget; // Perhaps we're seeing one of the default toolbar items // being clicked. @@ -158,6 +209,10 @@ this.BrowserUITelemetry = { let document = win.document; let result = {}; + // Determine if the Bookmarks bar is currently visible + let bookmarksBar = document.getElementById("PersonalToolbar"); + result.bookmarksBarEnabled = bookmarksBar && !bookmarksBar.collapsed; + result.countableEvents = this._countableEvents; return result; From 3657b295cab670a355329ed5551d6403c78f2573 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 17 Dec 2013 14:35:28 -0800 Subject: [PATCH 16/17] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ======== https://hg.mozilla.org/integration/gaia-central/rev/9a48d68efd0e Author: Pavel Ivanov Desc: Merge pull request #14782 from pivanov/bug-943701 Bug 943701 - [Settings] the “Do Not Track” panel is broken ======== https://hg.mozilla.org/integration/gaia-central/rev/06b0b0c6fab5 Author: Pavel Ivanov Desc: Bug 943701 - [Settings] the “Do Not Track” panel is broken --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index c37462c22eb..109aadbd416 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "d12b645e3b8b60cf020f0c0c6ef3bb74fc71c9d2", + "revision": "9a48d68efd0e0ca873dea5000e5ccd3afcff8802", "repo_path": "/integration/gaia-central" } From 0689f52f5d7992bf79d76b9dbab858f136ddec35 Mon Sep 17 00:00:00 2001 From: Gaia Pushbot Date: Tue, 17 Dec 2013 16:30:24 -0800 Subject: [PATCH 17/17] Bumping gaia.json for 2 gaia-central revision(s) a=gaia-bump MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ======== https://hg.mozilla.org/integration/gaia-central/rev/2cc6e0988688 Author: Mihai Cîrlănaru Desc: Merge pull request #14236 from mihai/bug_937499 Bug 937499 - [Settings] Update input type and trigger showing keyboard ... r=@crh0716 ======== https://hg.mozilla.org/integration/gaia-central/rev/74c6bf0e73b7 Author: Mihai Cirlanaru Desc: Bug 937499 - [Settings] Update input type and trigger showing keyboard for certain subpanels. r=arthurcc Use correct type and inputmode for input fields from the following panels: - Wi-Fi->Connect with WPS - Cellular & Data->Data settings - Cellular & Data->Message settings - Cellular & Data->A-GPS settings Trigger showing the keyboard for the following subpanels: - Call Settings->Voicemail - Bluetooth->Rename my device --- b2g/config/gaia.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/b2g/config/gaia.json b/b2g/config/gaia.json index 109aadbd416..32ed9f970db 100644 --- a/b2g/config/gaia.json +++ b/b2g/config/gaia.json @@ -1,4 +1,4 @@ { - "revision": "9a48d68efd0e0ca873dea5000e5ccd3afcff8802", + "revision": "2cc6e0988688b33fa46e3a05a726fb7919d7420e", "repo_path": "/integration/gaia-central" }