mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-01 08:42:13 +00:00
Backed out 3 changesets (bug 1208295
) for browser_offlineQuotaNotification.js bustage CLOSED TREE
Backed out changeset 1c16e9f4aa2f (bug1208295
) Backed out changeset 3242ff9a86bb (bug1208295
) Backed out changeset 04f2a2c320a3 (bug1208295
)
This commit is contained in:
parent
c8c8abd6a0
commit
4ce68a706d
@ -339,7 +339,6 @@ skip-if = os != "win" # The Fitts Law menu button is only supported on Windows (
|
||||
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]
|
||||
|
@ -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);
|
||||
});
|
||||
});
|
@ -276,9 +276,6 @@ BrowserGlue.prototype = {
|
||||
// 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;
|
||||
@ -591,7 +588,6 @@ BrowserGlue.prototype = {
|
||||
// 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);
|
||||
@ -640,7 +636,6 @@ BrowserGlue.prototype = {
|
||||
// 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");
|
||||
@ -2364,19 +2359,6 @@ BrowserGlue.prototype = {
|
||||
}
|
||||
}),
|
||||
|
||||
/**
|
||||
* 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.
|
||||
|
@ -1161,15 +1161,6 @@ NotificationObserver::Observe(nsISupports* aSubject, const char* aTopic,
|
||||
}
|
||||
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);
|
||||
|
@ -9,4 +9,3 @@ 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
|
||||
|
@ -139,8 +139,7 @@ enum {
|
||||
namespace mozilla {
|
||||
|
||||
enum {
|
||||
OSXNotificationActionDisable = 0,
|
||||
OSXNotificationActionSettings = 1,
|
||||
OSXNotificationActionDisable = 0
|
||||
};
|
||||
|
||||
class OSXNotificationInfo {
|
||||
@ -254,15 +253,13 @@ OSXNotificationCenter::ShowAlertNotification(const nsAString & aImageUrl, const
|
||||
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);
|
||||
@ -270,8 +267,7 @@ OSXNotificationCenter::ShowAlertNotification(const nsAString & aImageUrl, const
|
||||
[(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"];
|
||||
}
|
||||
@ -398,9 +394,6 @@ OSXNotificationCenter::OnActivate(NSString *aAlertName,
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user