Bug 1356569 - Remove notifyObservers' last parameter when it is falsy, rs=Fallen.
This commit is contained in:
Родитель
09ed0fc75a
Коммит
ed8679f38d
|
@ -862,7 +862,7 @@ AccountsService.prototype = {
|
|||
.map(this.getAccountByNumericId, this)
|
||||
.filter(a => a);
|
||||
|
||||
Services.obs.notifyObservers(this, "account-list-updated", null);
|
||||
Services.obs.notifyObservers(this, "account-list-updated");
|
||||
},
|
||||
|
||||
get _accountList() { return Services.prefs.getCharPref(kPrefMessengerAccounts); },
|
||||
|
@ -985,7 +985,7 @@ AccountsService.prototype = {
|
|||
|
||||
// Notify observers so that any message stating that autologin is
|
||||
// disabled can be removed
|
||||
Services.obs.notifyObservers(this, "autologin-processed", null);
|
||||
Services.obs.notifyObservers(this, "autologin-processed");
|
||||
},
|
||||
|
||||
_checkingIfPasswordStillMissing: false,
|
||||
|
@ -1047,7 +1047,7 @@ AccountsService.prototype = {
|
|||
let list = this._accountList;
|
||||
this._accountList = list ? list + "," + key : key;
|
||||
|
||||
Services.obs.notifyObservers(account, "account-added", null);
|
||||
Services.obs.notifyObservers(account, "account-added");
|
||||
return account;
|
||||
},
|
||||
|
||||
|
@ -1064,7 +1064,7 @@ AccountsService.prototype = {
|
|||
account.remove();
|
||||
this._accounts.splice(index, 1);
|
||||
delete this._accountsById[id];
|
||||
Services.obs.notifyObservers(account, "account-removed", null);
|
||||
Services.obs.notifyObservers(account, "account-removed");
|
||||
|
||||
/* Update the account list pref. */
|
||||
let list = this._accountList;
|
||||
|
|
|
@ -264,8 +264,8 @@ var otherContactsTag = {
|
|||
if (contact.getTags().some(t => t.id == id))
|
||||
this._removeContact(contact);
|
||||
|
||||
aTag.notifyObservers(aTag, "tag-shown", null);
|
||||
Services.obs.notifyObservers(aTag, "tag-shown", null);
|
||||
aTag.notifyObservers(aTag, "tag-shown");
|
||||
Services.obs.notifyObservers(aTag, "tag-shown");
|
||||
this._saveHiddenTagsPref();
|
||||
},
|
||||
hideTag: function(aTag) {
|
||||
|
@ -276,8 +276,8 @@ var otherContactsTag = {
|
|||
if (this._contactsInitialized)
|
||||
this._hideTag(aTag);
|
||||
|
||||
aTag.notifyObservers(aTag, "tag-hidden", null);
|
||||
Services.obs.notifyObservers(aTag, "tag-hidden", null);
|
||||
aTag.notifyObservers(aTag, "tag-hidden");
|
||||
Services.obs.notifyObservers(aTag, "tag-hidden");
|
||||
this._saveHiddenTagsPref();
|
||||
},
|
||||
_hideTag: function(aTag) {
|
||||
|
@ -583,7 +583,7 @@ Contact.prototype = {
|
|||
observer.observe(aNewTag, "contact-moved-in", null);
|
||||
Services.obs.notifyObservers(this, "contact-tag-added", aNewTag.id);
|
||||
}
|
||||
Services.obs.notifyObservers(this, "contact-moved", null);
|
||||
Services.obs.notifyObservers(this, "contact-moved");
|
||||
},
|
||||
|
||||
getBuddies: function(aBuddyCount) {
|
||||
|
|
|
@ -81,7 +81,7 @@ function UIConversation(aPrplConversation)
|
|||
// XPConnect will create a wrapper around 'this' after here,
|
||||
// so the list of exposed interfaces shouldn't change anymore.
|
||||
this.updateContactObserver();
|
||||
Services.obs.notifyObservers(this, "new-ui-conversation", null);
|
||||
Services.obs.notifyObservers(this, "new-ui-conversation");
|
||||
}
|
||||
|
||||
UIConversation.prototype = {
|
||||
|
@ -403,7 +403,7 @@ UIConversation.prototype = {
|
|||
return;
|
||||
delete this._currentTargetId;
|
||||
this.notifyObservers(this, "ui-conversation-closed");
|
||||
Services.obs.notifyObservers(this, "ui-conversation-closed", null);
|
||||
Services.obs.notifyObservers(this, "ui-conversation-closed");
|
||||
},
|
||||
addObserver: function(aObserver) {
|
||||
if (!this._observers.includes(aObserver))
|
||||
|
@ -569,7 +569,7 @@ ConversationsService.prototype = {
|
|||
this._prplConversations.push(aPrplConversation);
|
||||
|
||||
// Notify observers.
|
||||
Services.obs.notifyObservers(aPrplConversation, "new-conversation", null);
|
||||
Services.obs.notifyObservers(aPrplConversation, "new-conversation");
|
||||
|
||||
// Update or create the corresponding UI conversation.
|
||||
let contactId;
|
||||
|
@ -594,7 +594,7 @@ ConversationsService.prototype = {
|
|||
this._uiConvByContactId[contactId] = newUIConv;
|
||||
},
|
||||
removeConversation: function(aPrplConversation) {
|
||||
Services.obs.notifyObservers(aPrplConversation, "conversation-closed", null);
|
||||
Services.obs.notifyObservers(aPrplConversation, "conversation-closed");
|
||||
|
||||
let uiConv = this.getUIConversation(aPrplConversation);
|
||||
delete this._uiConv[aPrplConversation.id];
|
||||
|
@ -602,7 +602,7 @@ ConversationsService.prototype = {
|
|||
if (uiConv.removeTarget(aPrplConversation, contactId)) {
|
||||
if (contactId.value)
|
||||
delete this._uiConvByContactId[contactId.value];
|
||||
Services.obs.notifyObservers(uiConv, "ui-conversation-closed", null);
|
||||
Services.obs.notifyObservers(uiConv, "ui-conversation-closed");
|
||||
}
|
||||
this.forgetConversation(aPrplConversation);
|
||||
},
|
||||
|
|
|
@ -264,7 +264,7 @@ CoreService.prototype = {
|
|||
accounts.initAccounts();
|
||||
Services.contacts.initContacts();
|
||||
Services.conversations.initConversations();
|
||||
Services.obs.notifyObservers(this, "prpl-init", null);
|
||||
Services.obs.notifyObservers(this, "prpl-init");
|
||||
|
||||
// Wait with automatic connections until the password service
|
||||
// is available.
|
||||
|
@ -283,7 +283,7 @@ CoreService.prototype = {
|
|||
throw Cr.NS_ERROR_NOT_INITIALIZED;
|
||||
|
||||
Services.obs.removeObserver(this, kQuitApplicationGranted);
|
||||
Services.obs.notifyObservers(this, "prpl-quit", null);
|
||||
Services.obs.notifyObservers(this, "prpl-quit");
|
||||
|
||||
Services.conversations.unInitConversations();
|
||||
Services.accounts.unInitAccounts();
|
||||
|
|
|
@ -961,7 +961,7 @@
|
|||
this.contentChatNode
|
||||
.addEventListener("load", this.onContentElementLoad, true);
|
||||
|
||||
Services.obs.notifyObservers(this, "conversation-loaded", null);
|
||||
Services.obs.notifyObservers(this, "conversation-loaded");
|
||||
}
|
||||
]]>
|
||||
</body>
|
||||
|
|
|
@ -149,8 +149,7 @@ var GenericAccountPrototype = {
|
|||
},
|
||||
cancel: function() {
|
||||
Services.obs.notifyObservers(this,
|
||||
"buddy-authorization-request-canceled",
|
||||
null);
|
||||
"buddy-authorization-request-canceled");
|
||||
this._remove();
|
||||
},
|
||||
_remove: function() {
|
||||
|
@ -159,8 +158,7 @@ var GenericAccountPrototype = {
|
|||
QueryInterface: XPCOMUtils.generateQI([Ci.prplIBuddyRequest])
|
||||
};
|
||||
this._pendingBuddyRequests.push(buddyRequest);
|
||||
Services.obs.notifyObservers(buddyRequest, "buddy-authorization-request",
|
||||
null);
|
||||
Services.obs.notifyObservers(buddyRequest, "buddy-authorization-request");
|
||||
},
|
||||
removeBuddyRequest: function(aRequest) {
|
||||
if (!this._pendingBuddyRequests)
|
||||
|
@ -415,7 +413,7 @@ var GenericMessagePrototype = {
|
|||
get conversation() { return this._conversation; },
|
||||
set conversation(aConv) {
|
||||
this._conversation = aConv;
|
||||
aConv.notifyObservers(this, "new-text", null);
|
||||
aConv.notifyObservers(this, "new-text");
|
||||
},
|
||||
|
||||
outgoing: false,
|
||||
|
@ -499,7 +497,7 @@ var GenericConversationPrototype = {
|
|||
sendTyping: aString => Ci.prplIConversation.NO_TYPING_LIMIT,
|
||||
|
||||
close: function() {
|
||||
Services.obs.notifyObservers(this, "closing-conversation", null);
|
||||
Services.obs.notifyObservers(this, "closing-conversation");
|
||||
Services.conversations.removeConversation(this);
|
||||
},
|
||||
unInit: function() {
|
||||
|
|
|
@ -380,7 +380,7 @@ TimelineConversation.prototype = {
|
|||
sendTyping: function(aString) {
|
||||
if (aString.length == 0 && this.inReplyToStatusId) {
|
||||
delete this.inReplyToStatusId;
|
||||
this.notifyObservers(null, "status-text-changed", "");
|
||||
this.notifyObservers(null, "status-text-changed");
|
||||
return kMaxMessageLength;
|
||||
}
|
||||
return kMaxMessageLength - this.getTweetLength(aString);
|
||||
|
@ -970,7 +970,7 @@ Account.prototype = {
|
|||
},
|
||||
QueryInterface: XPCOMUtils.generateQI([Ci.prplIRequestBrowser])
|
||||
};
|
||||
Services.obs.notifyObservers(this._browserRequest, "browser-request", null);
|
||||
Services.obs.notifyObservers(this._browserRequest, "browser-request");
|
||||
},
|
||||
finishAuthorizationRequest: function() {
|
||||
// Clean up the cookies, so that several twitter OAuth dialogs can work
|
||||
|
|
|
@ -212,7 +212,7 @@ var fake = {
|
|||
new Account("tom.smith@yahoo.com", "prpl-yahoo"),
|
||||
new Account("tom@irc.mozilla.org", "prpl-irc")];
|
||||
for (let account of this.accounts)
|
||||
Services.obs.notifyObservers(account, "account-added", null);
|
||||
Services.obs.notifyObservers(account, "account-added");
|
||||
|
||||
var win = Components.classes["@mozilla.org/appshell/window-mediator;1"]
|
||||
.getService(Components.interfaces.nsIWindowMediator)
|
||||
|
|
|
@ -44,7 +44,7 @@ var gAdvancedPane = {
|
|||
let bundlePrefs = document.getElementById("bundlePreferences");
|
||||
|
||||
// Notify observers that the UI is now ready
|
||||
Services.obs.notifyObservers(window, "advanced-pane-loaded", null);
|
||||
Services.obs.notifyObservers(window, "advanced-pane-loaded");
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -162,7 +162,7 @@ var Conversations = {
|
|||
},
|
||||
|
||||
hideConversation: function(aConv) {
|
||||
Services.obs.notifyObservers(aConv, "ui-conversation-hidden", null);
|
||||
Services.obs.notifyObservers(aConv, "ui-conversation-hidden");
|
||||
if (!aConv.isChat)
|
||||
return;
|
||||
let accountId = aConv.account.id;
|
||||
|
@ -188,7 +188,7 @@ var Conversations = {
|
|||
this._pendingConversations.includes(aConv)))
|
||||
return;
|
||||
|
||||
Services.obs.notifyObservers(aConv, "showing-ui-conversation", null);
|
||||
Services.obs.notifyObservers(aConv, "showing-ui-conversation");
|
||||
// The conversation is not displayed anywhere yet.
|
||||
// First, check if an existing conversation window can accept it.
|
||||
for (let win of this._windows)
|
||||
|
|
|
@ -21,7 +21,7 @@ function UpdateMailToolbar(caller)
|
|||
document.commandDispatcher.updateCommands('mail-toolbar');
|
||||
|
||||
// hook for extra toolbar items
|
||||
Services.obs.notifyObservers(window, "mail:updateToolbarItems", null);
|
||||
Services.obs.notifyObservers(window, "mail:updateToolbarItems");
|
||||
}
|
||||
|
||||
function isNewsURI(uri)
|
||||
|
|
|
@ -967,7 +967,7 @@ FolderDisplayWidget.prototype = {
|
|||
// valid at the time we generate the notification. In such a case, you
|
||||
// can easily get that information from the gDBView. (The documentation
|
||||
// on creating a custom column assumes gDBView.)
|
||||
Services.obs.notifyObservers(this.displayedFolder, "MsgCreateDBView", "");
|
||||
Services.obs.notifyObservers(this.displayedFolder, "MsgCreateDBView");
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -449,7 +449,7 @@ function openAddonsMgr(aView)
|
|||
}
|
||||
}
|
||||
Services.obs.addObserver(receivePong, "EM-pong");
|
||||
Services.obs.notifyObservers(null, "EM-ping", "");
|
||||
Services.obs.notifyObservers(null, "EM-ping");
|
||||
Services.obs.removeObserver(receivePong, "EM-pong");
|
||||
|
||||
if (emWindow) {
|
||||
|
|
|
@ -324,7 +324,7 @@ var messagepaneObserver = {
|
|||
function UpdateStatusMessageCounts()
|
||||
{
|
||||
// hook for extra toolbar items
|
||||
Services.obs.notifyObservers(window, "mail:updateStandAloneMessageCounts", "");
|
||||
Services.obs.notifyObservers(window, "mail:updateStandAloneMessageCounts");
|
||||
}
|
||||
|
||||
// we won't show the window until the onload() handler is finished
|
||||
|
|
|
@ -527,11 +527,11 @@ function LoadPostAccountWizard()
|
|||
// On windows, there seems to be a delay between setting TB as the
|
||||
// default client, and the isDefaultClient check succeeding.
|
||||
if (shellService.isDefaultClient(true, nsIShellService.MAIL))
|
||||
Services.obs.notifyObservers(window, "mail:setAsDefault", null);
|
||||
Services.obs.notifyObservers(window, "mail:setAsDefault");
|
||||
}
|
||||
}
|
||||
// All core modal dialogs are done, the user can now interact with the 3-pane window
|
||||
Services.obs.notifyObservers(window, "mail-startup-done", null);
|
||||
Services.obs.notifyObservers(window, "mail-startup-done");
|
||||
}
|
||||
|
||||
setTimeout(completeStartup, 0);
|
||||
|
@ -609,7 +609,7 @@ function FindOther3PaneWindow()
|
|||
*/
|
||||
function OnUnloadMessenger()
|
||||
{
|
||||
Services.obs.notifyObservers(window, "mail-unloading-messenger", null);
|
||||
Services.obs.notifyObservers(window, "mail-unloading-messenger");
|
||||
accountManager.removeIncomingServerListener(gThreePaneIncomingServerListener);
|
||||
Services.prefs.removeObserver("mail.pane_config.dynamic", MailPrefObserver);
|
||||
Services.prefs.removeObserver("mail.showCondensedAddresses", MailPrefObserver);
|
||||
|
@ -679,7 +679,7 @@ async function atStartupRestoreTabs(aDontRestoreFirstTab) {
|
|||
// it's now safe to load extra Tabs.
|
||||
setTimeout(loadExtraTabs, 0);
|
||||
sessionStoreManager._restored = true;
|
||||
Services.obs.notifyObservers(window, "mail-tabs-session-restored", null);
|
||||
Services.obs.notifyObservers(window, "mail-tabs-session-restored");
|
||||
return state ? true : false;
|
||||
}
|
||||
|
||||
|
|
|
@ -365,7 +365,7 @@ var gPluginHandler = {
|
|||
// Notify all windows that an application quit has been requested.
|
||||
let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
|
||||
createInstance(Ci.nsISupportsPRBool);
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", null);
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested");
|
||||
|
||||
// Something aborted the quit process.
|
||||
if (cancelQuit.data)
|
||||
|
|
|
@ -169,7 +169,7 @@ Sanitizer.prototype = {
|
|||
try {
|
||||
var os = Components.classes["@mozilla.org/observer-service;1"]
|
||||
.getService(Components.interfaces.nsIObserverService);
|
||||
os.notifyObservers(null, "browser:purge-session-history", "");
|
||||
os.notifyObservers(null, "browser:purge-session-history");
|
||||
} catch (e) { }
|
||||
|
||||
try {
|
||||
|
|
|
@ -180,7 +180,7 @@
|
|||
// of our mozmill tests.
|
||||
let observerCallback = function() {
|
||||
Services.obs.notifyObservers(gFolderDisplay.displayedFolder,
|
||||
"msg-folder-columns-propagated", "");
|
||||
"msg-folder-columns-propagated");
|
||||
};
|
||||
MailUtils.setStringPropertyOnFolderAndDescendents(
|
||||
propName, colStateString, aDestFolder, observerCallback
|
||||
|
|
|
@ -1280,7 +1280,7 @@ function setupEventListeners() {
|
|||
});
|
||||
$("restart-in-safe-mode-button").addEventListener("click", function(event) {
|
||||
if (Services.obs.enumerateObservers("restart-in-safe-mode").hasMoreElements()) {
|
||||
Services.obs.notifyObservers(null, "restart-in-safe-mode", "");
|
||||
Services.obs.notifyObservers(null, "restart-in-safe-mode");
|
||||
} else {
|
||||
safeModeRestart();
|
||||
}
|
||||
|
|
|
@ -557,7 +557,7 @@ var gSendListener = {
|
|||
onStatus: function (aMsgID, aMsg) {},
|
||||
onStopSending: function (aMsgID, aStatus, aMsg, aReturnFile) {
|
||||
if (Components.isSuccessCode(aStatus))
|
||||
Services.obs.notifyObservers(null, "mail:composeSendSucceeded", null);
|
||||
Services.obs.notifyObservers(null, "mail:composeSendSucceeded");
|
||||
},
|
||||
onGetDraftFolderURI: function (aFolderURI) {},
|
||||
onSendNotPerformed: function (aMsgID, aStatus) {},
|
||||
|
@ -1835,7 +1835,7 @@ function convertListItemsToRegularAttachment(aItems)
|
|||
|
||||
dispatchAttachmentBucketEvent("attachments-converted", convertedAttachments);
|
||||
Services.obs.notifyObservers(convertedAttachments,
|
||||
"mail:attachmentsConverted", null);
|
||||
"mail:attachmentsConverted");
|
||||
|
||||
// We leave the content location in for the notifications because
|
||||
// it may be needed to identify the attachment. But clear it out now.
|
||||
|
@ -3318,7 +3318,7 @@ function GenericSendMessage(msgType)
|
|||
}
|
||||
|
||||
// hook for extra compose pre-processing
|
||||
Services.obs.notifyObservers(window, "mail:composeOnSend", null);
|
||||
Services.obs.notifyObservers(window, "mail:composeOnSend");
|
||||
|
||||
var originalCharset = gMsgCompose.compFields.characterSet;
|
||||
// Check if the headers of composing mail can be converted to a mail charset.
|
||||
|
|
|
@ -73,7 +73,7 @@ var ChatCore = {
|
|||
});
|
||||
|
||||
ChatCore.initialized = true;
|
||||
Services.obs.notifyObservers(null, "chat-core-initialized", null);
|
||||
Services.obs.notifyObservers(null, "chat-core-initialized");
|
||||
ChatCore._initializing = false;
|
||||
return true;
|
||||
},
|
||||
|
|
|
@ -46,7 +46,7 @@ var Notifications = {
|
|||
if (!Services.focus.activeWindow ||
|
||||
Services.wm.getMostRecentWindow("mail:3pane").document
|
||||
.getElementById("tabmail").currentTabInfo.mode.name != "chat")
|
||||
Services.obs.notifyObservers(aMessage, "play-chat-notification-sound", false);
|
||||
Services.obs.notifyObservers(aMessage, "play-chat-notification-sound");
|
||||
|
||||
// If TB window has focus, there's no need to show the notification..
|
||||
if (Services.wm.getMostRecentWindow("mail:3pane").document.hasFocus()) {
|
||||
|
|
|
@ -904,7 +904,7 @@ var gApplicationsPane = {
|
|||
self.rebuildView();
|
||||
|
||||
// Notify observers that the UI is now ready
|
||||
Services.obs.notifyObservers(window, "app-handler-pane-loaded", null);
|
||||
Services.obs.notifyObservers(window, "app-handler-pane-loaded");
|
||||
}
|
||||
setTimeout(_delayedPaneLoad, 0, this);
|
||||
},
|
||||
|
|
|
@ -82,8 +82,7 @@ function test_can_cancel_quit_on_changes() {
|
|||
// Trigger the quit-application-request notification
|
||||
|
||||
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested",
|
||||
null);
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested");
|
||||
|
||||
let promptState = gMockPromptService.promptState;
|
||||
assert_not_equals(null, promptState, "Expected a confirmEx prompt");
|
||||
|
@ -125,8 +124,7 @@ function test_can_quit_on_changes() {
|
|||
gMockPromptService.returnValue = DONT_SAVE;
|
||||
|
||||
// Trigger the quit-application-request notification
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested",
|
||||
null);
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested");
|
||||
|
||||
promptState = gMockPromptService.promptState;
|
||||
assert_not_equals(null, promptState, "Expected a confirmEx prompt");
|
||||
|
@ -177,8 +175,7 @@ function test_window_quit_state_reset_on_aborted_quit() {
|
|||
gMockPromptService.returnValue = DONT_SAVE;
|
||||
|
||||
// Trigger the quit-application-request notification
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested",
|
||||
null);
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested");
|
||||
|
||||
// We should have cancelled the quit appropriately.
|
||||
assert_true(cancelQuit.data);
|
||||
|
|
|
@ -235,8 +235,7 @@ function test_can_cancel_quit_on_filter_changes() {
|
|||
// cancel the quit.
|
||||
gMockPromptService.returnValue = false;
|
||||
// Trigger the quit-application-request notification
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested",
|
||||
null);
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested");
|
||||
let promptState = gMockPromptService.promptState;
|
||||
assert_not_equals(null, promptState, "Expected a confirmEx prompt");
|
||||
|
||||
|
@ -277,8 +276,7 @@ function test_can_quit_on_filter_changes() {
|
|||
// allow the quit.
|
||||
gMockPromptService.returnValue = true;
|
||||
// Trigger the quit-application-request notification
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested",
|
||||
null);
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested");
|
||||
let promptState = gMockPromptService.promptState;
|
||||
assert_not_equals(null, promptState, "Expected a confirmEx prompt");
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ function postShutdownNotifications()
|
|||
// to cancel this, our test should fail.
|
||||
var cancelQuit = Cc["@mozilla.org/supports-PRBool;1"]
|
||||
.createInstance(Components.interfaces.nsISupportsPRBool);
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested", null);
|
||||
Services.obs.notifyObservers(cancelQuit, "quit-application-requested");
|
||||
if (cancelQuit.data) {
|
||||
do_throw("Cannot shutdown: Someone cancelled the quit request!");
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ function postShutdownNotifications()
|
|||
"profile-change-teardown",
|
||||
"profile-before-change"];
|
||||
notifications.forEach(function(notification) {
|
||||
Services.obs.notifyObservers(null, notification, null);
|
||||
Services.obs.notifyObservers(null, notification);
|
||||
});
|
||||
|
||||
// finally, the xpcom-shutdown notification is handled by XPCOM itself.
|
||||
|
|
|
@ -772,7 +772,7 @@ function DelayedStartup() {
|
|||
setTimeout(function() { SafeBrowsing.init(); }, 2000);
|
||||
|
||||
gBrowserInit.delayedStartupFinished = true;
|
||||
Services.obs.notifyObservers(window, "browser-delayed-startup-finished", "");
|
||||
Services.obs.notifyObservers(window, "browser-delayed-startup-finished");
|
||||
}
|
||||
|
||||
function UpdateNavBar()
|
||||
|
@ -2569,11 +2569,11 @@ function WindowIsClosing()
|
|||
if (!gPrivate && !/Mac/.test(navigator.platform) && isClosingLastBrowser()) {
|
||||
let closingCanceled = Components.classes["@mozilla.org/supports-PRBool;1"]
|
||||
.createInstance(Components.interfaces.nsISupportsPRBool);
|
||||
Services.obs.notifyObservers(closingCanceled, "browser-lastwindow-close-requested", null);
|
||||
Services.obs.notifyObservers(closingCanceled, "browser-lastwindow-close-requested");
|
||||
if (closingCanceled.data)
|
||||
return false;
|
||||
|
||||
Services.obs.notifyObservers(null, "browser-lastwindow-close-granted", null);
|
||||
Services.obs.notifyObservers(null, "browser-lastwindow-close-granted");
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -337,7 +337,7 @@ function onLoadPageInfo()
|
|||
/* Select the requested tab, if the name is specified */
|
||||
var initialTab = (args && args.initialTab) || "generalTab";
|
||||
showTab(initialTab);
|
||||
Services.obs.notifyObservers(window, "page-info-dialog-loaded", null);
|
||||
Services.obs.notifyObservers(window, "page-info-dialog-loaded");
|
||||
}
|
||||
|
||||
function loadPageInfo()
|
||||
|
@ -395,7 +395,7 @@ function resetPageInfo(args)
|
|||
|
||||
if (args && args.initialTab)
|
||||
showTab(args.initialTab);
|
||||
Services.obs.notifyObservers(window, "page-info-dialog-reset", null);
|
||||
Services.obs.notifyObservers(window, "page-info-dialog-reset");
|
||||
}
|
||||
|
||||
function onUnloadPageInfo()
|
||||
|
|
|
@ -2404,7 +2404,7 @@
|
|||
.createInstance(Components.interfaces.nsISupportsPRBool);
|
||||
var os = Components.classes["@mozilla.org/observer-service;1"]
|
||||
.getService(Components.interfaces.nsIObserverService);
|
||||
os.notifyObservers(cancelQuit, "quit-application-requested", null);
|
||||
os.notifyObservers(cancelQuit, "quit-application-requested");
|
||||
|
||||
// Something aborted the quit process.
|
||||
if (cancelQuit.data)
|
||||
|
|
|
@ -332,7 +332,7 @@ var gDomains = {
|
|||
// Add domains for web storages.
|
||||
gDataman.debugMsg("Add storages to domain list: " + Date.now()/1000);
|
||||
// Force DOM Storage to write its data to the disk.
|
||||
Services.obs.notifyObservers(window, "domstorage-flush-timer", "");
|
||||
Services.obs.notifyObservers(window, "domstorage-flush-timer");
|
||||
yield setTimeout(nextStep, 0);
|
||||
gStorage.loadList();
|
||||
for (let sStorage of gStorage.storages) {
|
||||
|
@ -459,7 +459,7 @@ var gDomains = {
|
|||
yield setTimeout(nextStep, 0);
|
||||
|
||||
// Send a notification that we have finished.
|
||||
Services.obs.notifyObservers(window, "dataman-loaded", null);
|
||||
Services.obs.notifyObservers(window, "dataman-loaded");
|
||||
yield undefined;
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ function test() {
|
|||
win = content.wrappedJSObject;
|
||||
Services.obs.addObserver(testObs, TEST_DONE);
|
||||
// Trigger the first test now!
|
||||
Services.obs.notifyObservers(window, TEST_DONE, null);
|
||||
Services.obs.notifyObservers(window, TEST_DONE);
|
||||
}
|
||||
else {
|
||||
// TEST_DONE triggered, run next test
|
||||
|
@ -147,7 +147,7 @@ function test_open_state(aWin) {
|
|||
"After search, number of selections is correct");
|
||||
is(aWin.gDomains.selectedDomain.title, "mochi.test",
|
||||
"After search, matching selection is kept correctly");
|
||||
Services.obs.notifyObservers(window, TEST_DONE, null);
|
||||
Services.obs.notifyObservers(window, TEST_DONE);
|
||||
},
|
||||
|
||||
function test_forget_ipv6(aWin) {
|
||||
|
@ -176,7 +176,7 @@ function test_forget_ipv6(aWin) {
|
|||
aWin.gDomains.tree.view.selection.select(0);
|
||||
is(aWin.gDomains.selectedDomain.title, "*",
|
||||
"* domain is selected again");
|
||||
Services.obs.notifyObservers(window, TEST_DONE, null);
|
||||
Services.obs.notifyObservers(window, TEST_DONE);
|
||||
},
|
||||
|
||||
function test_fdata_panel(aWin) {
|
||||
|
@ -250,7 +250,7 @@ function test_fdata_panel(aWin) {
|
|||
"After remove button, one item is selected again");
|
||||
is(aWin.gFormdata.tree.currentIndex, 4,
|
||||
"After remove button, correct index is selected");
|
||||
Services.obs.notifyObservers(window, TEST_DONE, null);
|
||||
Services.obs.notifyObservers(window, TEST_DONE);
|
||||
},
|
||||
|
||||
function test_cookies_panel(aWin) {
|
||||
|
@ -313,7 +313,7 @@ function test_cookies_panel(aWin) {
|
|||
"No panel is active");
|
||||
is(aWin.gTabs.tabbox.selectedTab.disabled, true,
|
||||
"The selected panel is disabled");
|
||||
Services.obs.notifyObservers(window, TEST_DONE, null);
|
||||
Services.obs.notifyObservers(window, TEST_DONE);
|
||||
},
|
||||
|
||||
function test_permissions_panel(aWin) {
|
||||
|
@ -467,7 +467,7 @@ function test_permissions_panel(aWin) {
|
|||
aWin.gDomains.tree.view.selection.select(8); // Switch back to rebuild the perm list.
|
||||
is(aWin.gPerms.list.children.length, 1,
|
||||
"After the test, the correct number of permissions is displayed in the list");
|
||||
Services.obs.notifyObservers(window, TEST_DONE, null);
|
||||
Services.obs.notifyObservers(window, TEST_DONE);
|
||||
},
|
||||
|
||||
function test_permissions_add(aWin) {
|
||||
|
@ -536,7 +536,7 @@ function test_permissions_add(aWin) {
|
|||
"On add, the host is set correctly");
|
||||
is(aWin.gPerms.addType.value, "",
|
||||
"Again, no type is selected");
|
||||
Services.obs.notifyObservers(window, TEST_DONE, null);
|
||||
Services.obs.notifyObservers(window, TEST_DONE);
|
||||
},
|
||||
|
||||
function test_prefs_panel(aWin) {
|
||||
|
@ -615,7 +615,7 @@ function test_prefs_panel(aWin) {
|
|||
aWin.gDomains.updateContext(); // don't actually open it, would be async
|
||||
is(aWin.document.getElementById("domain-context-forget").disabled, true,
|
||||
"The domain's forget context menu item is disabled");
|
||||
Services.obs.notifyObservers(window, TEST_DONE, null);
|
||||
Services.obs.notifyObservers(window, TEST_DONE);
|
||||
},
|
||||
|
||||
function test_passwords_panel(aWin) {
|
||||
|
@ -687,7 +687,7 @@ function test_passwords_panel(aWin) {
|
|||
"After deleting last password, the remove button is disabled");
|
||||
is(aWin.gTabs.activePanel, "cookiesPanel",
|
||||
"After deleting last password, cookies panel is selected again");
|
||||
Services.obs.notifyObservers(window, TEST_DONE, null);
|
||||
Services.obs.notifyObservers(window, TEST_DONE);
|
||||
},
|
||||
|
||||
function test_idn(aWin) {
|
||||
|
@ -773,7 +773,7 @@ function test_idn(aWin) {
|
|||
is(aWin.gTabs.activePanel, "permissionsPanel",
|
||||
"After deleting, correctly switched back to permissions panel");
|
||||
|
||||
Services.obs.notifyObservers(window, TEST_DONE, null);
|
||||
Services.obs.notifyObservers(window, TEST_DONE);
|
||||
},
|
||||
|
||||
function test_storage_load(aWin) {
|
||||
|
@ -792,9 +792,9 @@ function test_storage_load(aWin) {
|
|||
if (tab == storagetab) {
|
||||
gBrowser.tabContainer.removeEventListener("TabClose", this);
|
||||
// Force DOM Storage to write its data to the disk.
|
||||
Services.obs.notifyObservers(null, "domstorage-flush-timer", "");
|
||||
Services.obs.notifyObservers(null, "domstorage-flush-timer");
|
||||
Services.perms.remove("mochi.test", "offline-app");
|
||||
Services.obs.notifyObservers(window, TEST_DONE, null);
|
||||
Services.obs.notifyObservers(window, TEST_DONE);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
@ -804,7 +804,7 @@ function test_storage_load(aWin) {
|
|||
function test_storage_wait(aWin) {
|
||||
// Wait to make sure that DOM Storage flushing has actually worked.
|
||||
setTimeout(function foo() {
|
||||
Services.obs.notifyObservers(window, TEST_DONE, null); }, 1000);
|
||||
Services.obs.notifyObservers(window, TEST_DONE); }, 1000);
|
||||
},
|
||||
|
||||
function test_storage(aWin) {
|
||||
|
@ -838,7 +838,7 @@ function test_storage(aWin) {
|
|||
isnot(aWin.gTabs.activePanel, "storagePanel",
|
||||
"Storage panel is not selected any more");
|
||||
|
||||
Services.obs.notifyObservers(window, TEST_DONE, null);
|
||||
Services.obs.notifyObservers(window, TEST_DONE);
|
||||
},
|
||||
|
||||
function test_close(aWin) {
|
||||
|
@ -846,7 +846,7 @@ function test_close(aWin) {
|
|||
aWin.removeEventListener("unload", dmWindowClosedListener);
|
||||
isnot(content.document.documentElement.id, "dataman-page",
|
||||
"The active tab is not the Data Manager");
|
||||
Services.obs.notifyObservers(window, TEST_DONE, null);
|
||||
Services.obs.notifyObservers(window, TEST_DONE);
|
||||
}
|
||||
aWin.addEventListener("unload", dmWindowClosedListener);
|
||||
aWin.close();
|
||||
|
|
|
@ -74,7 +74,7 @@ nsContextMenu.prototype = {
|
|||
};
|
||||
subject.wrappedJSObject = subject;
|
||||
// Notifies the Addon-SDK which then populates addonInfo.
|
||||
Services.obs.notifyObservers(subject, "content-contextmenu", null);
|
||||
Services.obs.notifyObservers(subject, "content-contextmenu");
|
||||
|
||||
var popupNode = this.target;
|
||||
var doc = popupNode.ownerDocument;
|
||||
|
|
|
@ -118,12 +118,12 @@ function run_test_continue()
|
|||
|
||||
// Simulate an exit so that Sanitizer's init method checkSettings() is called.
|
||||
print("Simulate 'quit-application-granted' too for SeaMonkey.");
|
||||
Services.obs.notifyObservers(null, "quit-application-granted", null);
|
||||
Services.obs.notifyObservers(null, "quit-application-granted");
|
||||
|
||||
shutdownPlaces();
|
||||
|
||||
// Shutdown the download manager.
|
||||
Services.obs.notifyObservers(null, "quit-application", null);
|
||||
Services.obs.notifyObservers(null, "quit-application");
|
||||
}
|
||||
|
||||
function getDistinctNotifications() {
|
||||
|
|
|
@ -866,7 +866,7 @@ var gApplicationsPane = {
|
|||
this._rebuildView();
|
||||
|
||||
// Notify observers that the UI is now ready
|
||||
Services.obs.notifyObservers(window, "app-handler-pane-loaded", null);
|
||||
Services.obs.notifyObservers(window, "app-handler-pane-loaded");
|
||||
},
|
||||
|
||||
destroy: function() {
|
||||
|
|
|
@ -129,7 +129,7 @@ function AcceptDialog()
|
|||
.createInstance(Components.interfaces.nsISupportsPRBool);
|
||||
Components.classes["@mozilla.org/observer-service;1"]
|
||||
.getService(Components.interfaces.nsIObserverService)
|
||||
.notifyObservers(cancelQuit, "quit-application-requested", null);
|
||||
.notifyObservers(cancelQuit, "quit-application-requested");
|
||||
if (cancelQuit.data)
|
||||
return false;
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@ SessionStartup.prototype = {
|
|||
.createInstance(Components.interfaces.nsISupportsString);
|
||||
stateString.data = this._readFile(aFile) || "";
|
||||
|
||||
Services.obs.notifyObservers(stateString, "sessionstore-state-read", "");
|
||||
Services.obs.notifyObservers(stateString, "sessionstore-state-read");
|
||||
|
||||
return stateString.data;
|
||||
},
|
||||
|
|
|
@ -3321,7 +3321,7 @@ SessionStoreService.prototype = {
|
|||
// parentheses are for backwards compatibility with older sessionstore files
|
||||
stateString.data = this._toJSONString(aStateObj);
|
||||
|
||||
Services.obs.notifyObservers(stateString, "sessionstore-state-write", "");
|
||||
Services.obs.notifyObservers(stateString, "sessionstore-state-write");
|
||||
|
||||
// don't touch the file if an observer has deleted all state data
|
||||
if (stateString.data)
|
||||
|
@ -3777,7 +3777,7 @@ SessionStoreService.prototype = {
|
|||
run: function sss_run() {
|
||||
// This was the last window restored at startup, notify observers.
|
||||
Services.obs.notifyObservers(this.windowToFocus,
|
||||
this._browserSetState ? NOTIFY_BROWSER_STATE_RESTORED : NOTIFY_WINDOWS_RESTORED, "");
|
||||
this._browserSetState ? NOTIFY_BROWSER_STATE_RESTORED : NOTIFY_WINDOWS_RESTORED);
|
||||
this._browserSetState = false;
|
||||
},
|
||||
|
||||
|
@ -3979,8 +3979,7 @@ SessionStoreService.prototype = {
|
|||
NetUtil.asyncCopy(istream, ostream, function(rc) {
|
||||
if (Components.isSuccessCode(rc)) {
|
||||
Services.obs.notifyObservers(null,
|
||||
"sessionstore-state-write-complete",
|
||||
"");
|
||||
"sessionstore-state-write-complete");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -128,7 +128,7 @@ function UpdateMailToolbar(caller)
|
|||
document.commandDispatcher.updateCommands('mail-toolbar');
|
||||
|
||||
// hook for extra toolbar items
|
||||
Services.obs.notifyObservers(window, "mail:updateToolbarItems", null);
|
||||
Services.obs.notifyObservers(window, "mail:updateToolbarItems");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -332,7 +332,7 @@ function RerootFolder(uri, newFolder, viewType, viewFlags, sortType, sortOrder)
|
|||
|
||||
UpdateMailToolbar("reroot folder in 3 pane");
|
||||
// hook for extra toolbar items
|
||||
Services.obs.notifyObservers(window, "mail:updateToolbarItems", null);
|
||||
Services.obs.notifyObservers(window, "mail:updateToolbarItems");
|
||||
// this is to kick off cross-folder searches for virtual folders.
|
||||
if (gSearchSession && !gVirtualFolderTerms) // another var might be better...
|
||||
{
|
||||
|
|
|
@ -1714,7 +1714,7 @@ function GenericSendMessage( msgType )
|
|||
}
|
||||
|
||||
// hook for extra compose pre-processing
|
||||
Services.obs.notifyObservers(window, "mail:composeOnSend", null);
|
||||
Services.obs.notifyObservers(window, "mail:composeOnSend");
|
||||
|
||||
var originalCharset = gMsgCompose.compFields.characterSet;
|
||||
// Check if the headers of composing mail can be converted to a mail charset.
|
||||
|
|
|
@ -130,7 +130,7 @@ function UpdateStandAloneMessageCounts()
|
|||
{
|
||||
// hook for extra toolbar items
|
||||
Services.obs.notifyObservers(window,
|
||||
"mail:updateStandAloneMessageCounts", "");
|
||||
"mail:updateStandAloneMessageCounts");
|
||||
}
|
||||
|
||||
nsMsgDBViewCommandUpdater.prototype =
|
||||
|
|
|
@ -745,7 +745,7 @@ function OnLoadMessenger()
|
|||
|
||||
window.setTimeout(loadStartFolder, 0, startFolderUri);
|
||||
|
||||
Services.obs.notifyObservers(window, "mail-startup-done", null);
|
||||
Services.obs.notifyObservers(window, "mail-startup-done");
|
||||
|
||||
// FIX ME - later we will be able to use onload from the overlay
|
||||
OnLoadMsgHeaderPane();
|
||||
|
|
|
@ -189,7 +189,7 @@ var Sanitizer = {
|
|||
try {
|
||||
var os = Components.classes["@mozilla.org/observer-service;1"]
|
||||
.getService(Components.interfaces.nsIObserverService);
|
||||
os.notifyObservers(null, "browser:purge-session-history", "");
|
||||
os.notifyObservers(null, "browser:purge-session-history");
|
||||
} catch(ex) {}
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче