Bug 1290882 - Remove 'Press back to exit' snackbar when entering fullscreen mode. r=ahunt draft
authorMichael Comella <michael.l.comella@gmail.com>
Wed, 21 Sep 2016 14:47:36 -0700
changeset 416326 99b81c1f71aca357c3a9ea34e63fc7d20bed994f
parent 415495 62f79d676e0e11b3ad59a5425b3ebb3ec5bbefb5
child 531818 1310fb53f46607833075e436d0aaedea1cd7379b
push id30103
push usermichael.l.comella@gmail.com
push dateWed, 21 Sep 2016 21:49:15 +0000
reviewersahunt
bugs1290882, 1031519
milestone52.0a1
Bug 1290882 - Remove 'Press back to exit' snackbar when entering fullscreen mode. r=ahunt We decided to remove it because: * Modern video controls include an exit fullscreen button * After bug 1031519, you have to swipe down from the top of the screen to display the soft back button so the copy does not make sense. Note that the `MozShowFullScreenWarning` event was removed previously in the platform in [1] so we remove the listener attachment here without replacing it. [1]: https://hg.mozilla.org/integration/fx-team/rev/a6a5f79e630d MozReview-Commit-ID: HwyyUkWkUUH
mobile/android/chrome/content/browser.js
mobile/android/locales/en-US/chrome/browser.properties
--- a/mobile/android/chrome/content/browser.js
+++ b/mobile/android/chrome/content/browser.js
@@ -384,20 +384,16 @@ var BrowserApp = {
     Services.obs.addObserver(this, "gather-telemetry", false);
     Services.obs.addObserver(this, "keyword-search", false);
     Services.obs.addObserver(this, "sessionstore-state-purge-complete", false);
     Services.obs.addObserver(this, "Fonts:Reload", false);
     Services.obs.addObserver(this, "Vibration:Request", false);
 
     Messaging.addListener(this.getHistory.bind(this), "Session:GetHistory");
 
-    function showFullScreenWarning() {
-      Snackbars.show(Strings.browser.GetStringFromName("alertFullScreenToast"), Snackbars.LENGTH_LONG);
-    }
-
     window.addEventListener("fullscreen", function() {
       Messaging.sendRequest({
         type: window.fullScreen ? "ToggleChrome:Hide" : "ToggleChrome:Show"
       });
     }, false);
 
     window.addEventListener("fullscreenchange", (e) => {
       // This event gets fired on the document and its entire ancestor chain
@@ -406,30 +402,24 @@ var BrowserApp = {
       // (per spec). This means the last event on enabling will be for the innermost
       // document, which will have fullscreenElement set correctly.
       let doc = e.target;
       Messaging.sendRequest({
         type: doc.fullscreenElement ? "DOMFullScreen:Start" : "DOMFullScreen:Stop",
         rootElement: doc.fullscreenElement == doc.documentElement
       });
 
-      if (doc.fullscreenElement) {
-        showFullScreenWarning();
-      } else if (this.fullscreenTransitionTab) {
+      if (this.fullscreenTransitionTab) {
         // Tab selection has changed during a fullscreen transition, handle it now.
         let tab = this.fullscreenTransitionTab;
         this.fullscreenTransitionTab = null;
         this._handleTabSelected(tab);
       }
     }, false);
 
-    // When a restricted key is pressed in DOM full-screen mode, we should display
-    // the "Press ESC to exit" warning message.
-    window.addEventListener("MozShowFullScreenWarning", showFullScreenWarning, true);
-
     NativeWindow.init();
     FormAssistant.init();
     IndexedDB.init();
     XPInstallObserver.init();
     CharacterEncoding.init();
     ActivityObserver.init();
     RemoteDebugger.init();
     UserAgentOverrides.init();
--- a/mobile/android/locales/en-US/chrome/browser.properties
+++ b/mobile/android/locales/en-US/chrome/browser.properties
@@ -27,18 +27,16 @@ alertDownloadsResume=Resume
 alertDownloadsCancel=Cancel
 # LOCALIZATION NOTE (alertDownloadSucceeded): This text is shown as a snackbar inside the app after a
 # successful download. %S will be replaced by the file name of the download.
 alertDownloadSucceeded=%S downloaded
 # LOCALIZATION NOTE (downloads.disabledInGuest): This message appears in a toast
 # when the user tries to download something in Guest mode.
 downloads.disabledInGuest=Downloads are disabled in guest sessions
 
-alertFullScreenToast=Press BACK to leave full-screen mode
-
 # LOCALIZATION NOTE (alertSearchEngineAddedToast, alertSearchEngineErrorToast, alertSearchEngineDuplicateToast)
 # %S will be replaced by the name of the search engine (exposed by the current page)
 # that has been added; for example, 'Google'.
 alertSearchEngineAddedToast='%S' has been added as a search engine
 alertSearchEngineErrorToast=Couldn't add '%S' as a search engine
 alertSearchEngineDuplicateToast='%S' is already one of your search engines
 
 alertPrintjobToast=Printing…