Bug 1221050 - part 0: remove notification for tab groups removal, r=ttaubert
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Tue, 01 Dec 2015 10:48:08 +0000
changeset 309109 aab2caaf721e15dce379cf1942298a3f6d2cf79f
parent 309108 c8fa681533edf8eba332a2b7d2bfe07bb2a3d30e
child 309110 a7fc92c9dc4cff1bafb170d1fef4ad689b4d55b2
push id5513
push userraliiev@mozilla.com
push dateMon, 25 Jan 2016 13:55:34 +0000
treeherdermozilla-beta@5ee97dd05b5c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert
bugs1221050
milestone45.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 1221050 - part 0: remove notification for tab groups removal, r=ttaubert
browser/components/nsBrowserGlue.js
browser/components/tabview/ui.js
browser/locales/en-US/chrome/browser/browser.properties
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1345,31 +1345,16 @@ BrowserGlue.prototype = {
 
       if (willPrompt) {
         Services.tm.mainThread.dispatch(function() {
           DefaultBrowserCheck.prompt(RecentWindow.getMostRecentBrowserWindow());
         }.bind(this), Ci.nsIThread.DISPATCH_NORMAL);
       }
     }
 
-    if (this._mayNeedToWarnAboutTabGroups) {
-      let haveTabGroups = false;
-      let wins = Services.wm.getEnumerator("navigator:browser");
-      while (wins.hasMoreElements()) {
-        let win = wins.getNext();
-        if (win.TabView._tabBrowserHasHiddenTabs() && win.TabView.firstUseExperienced) {
-          haveTabGroups = true;
-          break;
-        }
-      }
-      if (haveTabGroups) {
-        this._showTabGroupsDeprecationNotification();
-      }
-    }
-
 #ifdef E10S_TESTING_ONLY
     E10SUINotification.checkStatus();
 #else
     E10SAccessibilityCheck.init();
 #endif
   },
 
 #ifdef MOZ_DEV_EDITION
@@ -1400,37 +1385,16 @@ BrowserGlue.prototype = {
         }).then(null, e => {
           Cu.reportError("Could not empty profile 'default': " + e);
         });
       }
     }
   },
 #endif
 
-  _showTabGroupsDeprecationNotification() {
-    let brandShortName = gBrandBundle.GetStringFromName("brandShortName");
-    let text = gBrowserBundle.formatStringFromName("tabgroups.deprecationwarning.description",
-                                                   [brandShortName], 1);
-    let learnMore = gBrowserBundle.GetStringFromName("tabgroups.deprecationwarning.learnMore.label");
-    let learnMoreKey = gBrowserBundle.GetStringFromName("tabgroups.deprecationwarning.learnMore.accesskey");
-
-    let win = RecentWindow.getMostRecentBrowserWindow();
-    let notifyBox = win.document.getElementById("high-priority-global-notificationbox");
-    let button = {
-      label: learnMore,
-      accessKey: learnMoreKey,
-      callback: function(aNotificationBar, aButton) {
-        win.openUILinkIn("https://support.mozilla.org/kb/tab-groups-removal", "tab");
-      },
-    };
-
-    notifyBox.appendNotification(text, "tabgroups-removal-notification", null,
-                                 notifyBox.PRIORITY_WARNING_MEDIUM, [button]);
-  },
-
   _onQuitRequest: function BG__onQuitRequest(aCancelQuit, aQuitType) {
     // If user has already dismissed quit request, then do nothing
     if ((aCancelQuit instanceof Ci.nsISupportsPRBool) && aCancelQuit.data)
       return;
 
     // There are several cases where we won't show a dialog here:
     // 1. There is only 1 tab open in 1 window
     // 2. The session will be restored at startup, indicated by
@@ -2273,20 +2237,16 @@ BrowserGlue.prototype = {
       xulStore.removeValue(BROWSER_DOCURL, "bookmarks-menu-button", "class");
       xulStore.removeValue(BROWSER_DOCURL, "home-button", "class");
     }
 
     if (currentUIVersion < 32) {
       this._notifyNotificationsUpgrade().catch(Cu.reportError);
     }
 
-    if (currentUIVersion < 34) {
-      // We'll do something once windows are open:
-      this._mayNeedToWarnAboutTabGroups = true;
-    }
 
     // Update the migration version.
     Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
   },
 
   _hasExistingNotificationPermission: function BG__hasExistingNotificationPermission() {
     let enumerator = Services.perms.enumerator;
     while (enumerator.hasMoreElements()) {
--- a/browser/components/tabview/ui.js
+++ b/browser/components/tabview/ui.js
@@ -506,31 +506,27 @@ var UI = {
       dispatchEvent(event);
 
       // Flush pending updates
       GroupItems.flushAppTabUpdates();
 
       TabItems.resumePainting();
     }
 
-    this.notifyDeprecation();
-
     if (gTabView.firstUseExperienced)
       gTabView.enableSessionRestore();
   },
 
   // ----------
   // Function: hideTabView
   // Hides TabView and shows the main browser UI.
   hideTabView: function UI_hideTabView() {
     if (!this.isTabViewVisible() || this._isChangingVisibility)
       return;
 
-    iQ(".banner").remove();
-
     // another tab might be select if user decides to stay on a page when
     // a onclose confirmation prompts.
     GroupItems.removeHiddenGroups();
 
     // We need to set this after removing the hidden groups because doing so
     // might show prompts which will cause us to be called again, and we'd get
     // stuck if we prevent re-entrancy before doing that.
     this._isChangingVisibility = true;
@@ -1541,43 +1537,12 @@ var UI = {
     let onFadeIn = function () {
       setTimeout(function () {
         banner.animate({opacity: 0}, {duration: 1500, complete: onFadeOut});
       }, 5000);
     };
 
     banner.animate({opacity: 0.7}, {duration: 1500, complete: onFadeIn});
   },
-
-  // Function: notifyDeprecation
-  // Notify the user that tab groups will be deprecated soon.
-  notifyDeprecation() {
-    let brandBundle = gWindow.document.getElementById("bundle_brand");
-    let brandShortName = brandBundle.getString("brandShortName");
-    let browserBundle = gWindow.document.getElementById("bundle_browser");
-    let notificationText = browserBundle.getFormattedString(
-      "tabgroups.deprecationwarning.description", [brandShortName]);
-
-    let learnMoreText = browserBundle.getString("tabgroups.deprecationwarning.learnMore.label");
-
-    let onButtonClick = () => {
-      this.hideTabView();
-      gWindow.openUILinkIn("https://support.mozilla.org/kb/tab-groups-removal", "tab");
-    };
-
-    let button = iQ("<button>")
-      .text(learnMoreText)
-      .css('-moz-margin-start', '10px')
-      .one('click', onButtonClick);
-
-    let banner = iQ("<div>")
-      .text(notificationText)
-      .addClass("banner")
-      .css({background: 'linear-gradient(#ffe13e, #ffc703)', color: 'rgba(0,0,0,0.95)'})
-      .append(button)
-      .appendTo("body");
-
-    banner.animate({opacity: 0.7}, {duration: 1500});
-  },
 };
 
 // ----------
 UI.init();
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -798,13 +798,8 @@ muteTab.accesskey = M
 unmuteTab.label = Unmute Tab
 unmuteTab.accesskey = M
 
 # LOCALIZATION NOTE (weakCryptoOverriding.message): %S is brandShortName
 weakCryptoOverriding.message = %S recommends that you don't enter your password, credit card and other personal information on this website.
 revokeOverride.label = Don't Trust This Website
 revokeOverride.accesskey = D
 
-# LOCALIZATION NOTE (tabgroups.deprecationwarning.description):
-# %S is brandShortName
-tabgroups.deprecationwarning.description         = Heads up! Tab Groups will be removed from %S soon.
-tabgroups.deprecationwarning.learnMore.label     = Learn More
-tabgroups.deprecationwarning.learnMore.accesskey = L