Backed out 3 changesets (bug 1208295) for browser_offlineQuotaNotification.js bustage CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Fri, 25 Sep 2015 18:20:35 -0700
changeset 264704 e34f9feccd3fffef746608558ba5cd37c23d6ff9
parent 264703 4093d584009893aafd9de04a9157b314a8f43957
child 264705 d24fd81248c891451629ff86a024e435ed282bc1
push id65707
push usercbook@mozilla.com
push dateMon, 28 Sep 2015 12:18:34 +0000
treeherdermozilla-inbound@2c0e60a8f736 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1208295
milestone44.0a1
backs out1c16e9f4aa2ff3bae05243941adab5620365e4de
3242ff9a86bbc2f01836a02fbf6ddd5bd846ab65
04f2a2c320a39859720caf16a7f5b5de836ab997
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
Backed out 3 changesets (bug 1208295) for browser_offlineQuotaNotification.js bustage CLOSED TREE Backed out changeset 1c16e9f4aa2f (bug 1208295) Backed out changeset 3242ff9a86bb (bug 1208295) Backed out changeset 04f2a2c320a3 (bug 1208295)
browser/base/content/test/general/browser.ini
browser/base/content/test/general/browser_notification_open_settings.js
browser/components/nsBrowserGlue.js
dom/notification/Notification.cpp
toolkit/locales/en-US/chrome/alerts/alert.properties
widget/cocoa/OSXNotificationCenter.mm
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -334,17 +334,16 @@ skip-if = os == "linux" # Linux: Intermi
 [browser_locationBarExternalLoad.js]
 [browser_menuButtonFitts.js]
 skip-if = os != "win" # The Fitts Law menu button is only supported on Windows (bug 969376)
 [browser_middleMouse_noJSPaste.js]
 [browser_minimize.js]
 skip-if = e10s # Bug 1100664 - test directly access content docShells (TypeError: gBrowser.docShell is null)
 [browser_mixedcontent_securityflags.js]
 tags = mcb
-[browser_notification_open_settings.js]
 [browser_notification_tab_switching.js]
 skip-if = buildapp == 'mulet' || e10s # Bug 1100662 - content access causing uncaught exception - Error: cannot ipc non-cpow object at chrome://mochitests/content/browser/browser/base/content/test/general/browser_notification_tab_switching.js:32 (or in RemoteAddonsChild.jsm)
 [browser_offlineQuotaNotification.js]
 skip-if = buildapp == 'mulet' || e10s # Bug 1093603 - test breaks with PopupNotifications.panel.firstElementChild is null
 [browser_overflowScroll.js]
 [browser_pageInfo.js]
 skip-if = buildapp == 'mulet'
 [browser_page_style_menu.js]
deleted file mode 100644
--- a/browser/base/content/test/general/browser_notification_open_settings.js
+++ /dev/null
@@ -1,18 +0,0 @@
-"use strict";
-
-add_task(function* test_settingsOpen() {
-  info("Opening a dummy tab so openPreferences=>switchToTabHavingURI doesn't use the blank tab.");
-  yield BrowserTestUtils.withNewTab({
-    gBrowser,
-    url: "about:robots"
-  }, function* dummyTabTask(aBrowser) {
-    let tabPromise = BrowserTestUtils.waitForNewTab(gBrowser, "about:preferences#content");
-    info("simulate a notifications-open-settings notification");
-    let uri = NetUtil.newURI("https://example.com");
-    let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
-    Services.obs.notifyObservers(principal, "notifications-open-settings", null);
-    let tab = yield tabPromise;
-    ok(tab, "The notification settings tab opened");
-    BrowserTestUtils.removeTab(tab);
-  });
-});
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -271,19 +271,16 @@ BrowserGlue.prototype = {
     Cu.import("resource://services-sync/main.js");
     Weave.Service.scheduler.delayedAutoConnect(delay);
   },
 #endif
 
   // nsIObserver implementation
   observe: function BG_observe(subject, topic, data) {
     switch (topic) {
-      case "notifications-open-settings":
-        this._openPreferences("content");
-        break;
       case "prefservice:after-app-defaults":
         this._onAppDefaults();
         break;
       case "final-ui-startup":
         this._finalUIStartup();
         break;
       case "browser-delayed-startup-finished":
         this._onFirstWindowLoaded(subject);
@@ -586,17 +583,16 @@ BrowserGlue.prototype = {
     if (Services.search.isInitialized) {
       Services.search.defaultEngine = Services.search.currentEngine;
     }
   },
 
   // initialization (called on application startup) 
   _init: function BG__init() {
     let os = Services.obs;
-    os.addObserver(this, "notifications-open-settings", false);
     os.addObserver(this, "prefservice:after-app-defaults", false);
     os.addObserver(this, "final-ui-startup", false);
     os.addObserver(this, "browser-delayed-startup-finished", false);
     os.addObserver(this, "sessionstore-windows-restored", false);
     os.addObserver(this, "browser:purge-session-history", false);
     os.addObserver(this, "quit-application-requested", false);
     os.addObserver(this, "quit-application-granted", false);
 #ifdef OBSERVE_LASTWINDOW_CLOSE_TOPICS
@@ -635,17 +631,16 @@ BrowserGlue.prototype = {
     ExtensionManagement.registerScript("chrome://browser/content/ext-windows.js");
 
     this._flashHangCount = 0;
   },
 
   // cleanup (called on application shutdown)
   _dispose: function BG__dispose() {
     let os = Services.obs;
-    os.removeObserver(this, "notifications-open-settings");
     os.removeObserver(this, "prefservice:after-app-defaults");
     os.removeObserver(this, "final-ui-startup");
     os.removeObserver(this, "sessionstore-windows-restored");
     os.removeObserver(this, "browser:purge-session-history");
     os.removeObserver(this, "quit-application-requested");
     os.removeObserver(this, "quit-application-granted");
     os.removeObserver(this, "restart-in-safe-mode");
 #ifdef OBSERVE_LASTWINDOW_CLOSE_TOPICS
@@ -2359,29 +2354,16 @@ BrowserGlue.prototype = {
     } catch(ex) {
       Cu.reportError(ex);
     } finally {
       Services.prefs.setIntPref(SMART_BOOKMARKS_PREF, SMART_BOOKMARKS_VERSION);
       Services.prefs.savePrefFile(null);
     }
   }),
 
-  /**
-   * Open preferences even if there are no open windows.
-   */
-  _openPreferences(...args) {
-    if (Services.appShell.hiddenDOMWindow.openPreferences) {
-      Services.appShell.hiddenDOMWindow.openPreferences(...args);
-      return;
-    }
-
-    let chromeWindow = RecentWindow.getMostRecentBrowserWindow();
-    chromeWindow.openPreferences(...args);
-  },
-
 #ifdef MOZ_SERVICES_SYNC
   /**
    * Called as an observer when Sync's "display URI" notification is fired.
    *
    * We open the received URI in a background tab.
    *
    * Eventually, this will likely be replaced by a more robust tab syncing
    * feature. This functionality is considered somewhat evil by UX because it
--- a/dom/notification/Notification.cpp
+++ b/dom/notification/Notification.cpp
@@ -1156,25 +1156,16 @@ NotificationObserver::Observe(nsISupport
   if (!strcmp("alertdisablecallback", aTopic)) {
     nsCOMPtr<nsIPermissionManager> permissionManager =
       mozilla::services::GetPermissionManager();
     if (!permissionManager) {
       return NS_ERROR_FAILURE;
     }
     permissionManager->RemoveFromPrincipal(mPrincipal, "desktop-notification");
     return NS_OK;
-  } else if (!strcmp("alertsettingscallback", aTopic)) {
-    nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
-    if (!obs) {
-      return NS_ERROR_FAILURE;
-    }
-
-    // Notify other observers so they can show settings UI.
-    obs->NotifyObservers(mPrincipal, "notifications-open-settings", nullptr);
-    return NS_OK;
   }
 
   return mObserver->Observe(aSubject, aTopic, aData);
 }
 
 NS_IMETHODIMP
 MainThreadNotificationObserver::Observe(nsISupports* aSubject, const char* aTopic,
                                         const char16_t* aData)
--- a/toolkit/locales/en-US/chrome/alerts/alert.properties
+++ b/toolkit/locales/en-US/chrome/alerts/alert.properties
@@ -4,9 +4,8 @@
 
 # LOCALIZATION NOTE(closeButton.title): Used as the close button text for web notifications on OS X.
 # This should ideally match the string that OS X uses for the close button on alert-type
 # notifications. OS X will truncate the value if it's too long.
 closeButton.title = Close
 # LOCALIZATION NOTE(actionButton.label): Used as the button label to provide more actions on OS X notifications. OS X will truncate this if it's too long.
 actionButton.label = …
 webActions.disable.label = Disable notifications from this site
-webActions.settings.label = Notification settings
--- a/widget/cocoa/OSXNotificationCenter.mm
+++ b/widget/cocoa/OSXNotificationCenter.mm
@@ -134,18 +134,17 @@ enum {
   mOSXNC->CloseAlertCocoaString(name);
 }
 
 @end
 
 namespace mozilla {
 
 enum {
-  OSXNotificationActionDisable = 0,
-  OSXNotificationActionSettings = 1,
+  OSXNotificationActionDisable = 0
 };
 
 class OSXNotificationInfo {
 private:
   ~OSXNotificationInfo();
 
 public:
   NS_INLINE_DECL_REFCOUNTING(OSXNotificationInfo)
@@ -249,34 +248,31 @@ OSXNotificationCenter::ShowAlertNotifica
 
   // If this is not an application/extension alert, show additional actions dealing with permissions.
   if (aPrincipal && !nsContentUtils::IsSystemOrExpandedPrincipal(aPrincipal)
       && !aPrincipal->GetIsNullPrincipal()) {
     nsCOMPtr<nsIStringBundleService> sbs = do_GetService(NS_STRINGBUNDLE_CONTRACTID);
     nsCOMPtr<nsIStringBundle> bundle;
     nsresult rv = sbs->CreateBundle("chrome://alerts/locale/alert.properties", getter_AddRefs(bundle));
     if (NS_SUCCEEDED(rv)) {
-      nsXPIDLString closeButtonTitle, actionButtonTitle, disableButtonTitle, settingsButtonTitle;
+      nsXPIDLString closeButtonTitle, actionButtonTitle, disableButtonTitle;
       bundle->GetStringFromName(NS_LITERAL_STRING("closeButton.title").get(),
                                 getter_Copies(closeButtonTitle));
       bundle->GetStringFromName(NS_LITERAL_STRING("actionButton.label").get(),
                                 getter_Copies(actionButtonTitle));
       bundle->GetStringFromName(NS_LITERAL_STRING("webActions.disable.label").get(),
                                 getter_Copies(disableButtonTitle));
-      bundle->GetStringFromName(NS_LITERAL_STRING("webActions.settings.label").get(),
-                                getter_Copies(settingsButtonTitle));
 
       notification.hasActionButton = YES;
       notification.otherButtonTitle = nsCocoaUtils::ToNSString(closeButtonTitle);
       notification.actionButtonTitle = nsCocoaUtils::ToNSString(actionButtonTitle);
       [(NSObject*)notification setValue:@(YES) forKey:@"_showsButtons"];
       [(NSObject*)notification setValue:@(YES) forKey:@"_alwaysShowAlternateActionMenu"];
       [(NSObject*)notification setValue:@[
-                                          nsCocoaUtils::ToNSString(disableButtonTitle),
-                                          nsCocoaUtils::ToNSString(settingsButtonTitle)
+                                          nsCocoaUtils::ToNSString(disableButtonTitle)
                                           ]
                                forKey:@"_alternateActionButtonTitles"];
     }
   }
   NSString *alertName = [NSString stringWithCharacters:(const unichar *)aAlertName.BeginReading() length:aAlertName.Length()];
   if (!alertName) {
     return NS_ERROR_FAILURE;
   }
@@ -393,19 +389,16 @@ OSXNotificationCenter::OnActivate(NSStri
       if (osxni->mObserver) {
         switch (aActivationType) {
           case NSUserNotificationActivationTypeAdditionalActionClicked:
           case NSUserNotificationActivationTypeActionButtonClicked:
             switch (aAdditionalActionIndex) {
               case OSXNotificationActionDisable:
                 osxni->mObserver->Observe(nullptr, "alertdisablecallback", osxni->mCookie.get());
                 break;
-              case OSXNotificationActionSettings:
-                osxni->mObserver->Observe(nullptr, "alertsettingscallback", osxni->mCookie.get());
-                break;
               default:
                 NS_WARNING("Unknown NSUserNotification additional action clicked");
                 break;
             }
             break;
           default:
             osxni->mObserver->Observe(nullptr, "alertclickcallback", osxni->mCookie.get());
             break;