зеркало из https://github.com/mozilla/gecko-dev.git
Bug 961655 - Ensure that webapps-registry-ready event is fired, even if the Webapps registry is initialized before shell.html is loaded. r=fabrice
This commit is contained in:
Родитель
18397aa440
Коммит
b97f2606bc
|
@ -28,6 +28,9 @@ Cu.import('resource://gre/modules/FxAccountsMgmtService.jsm');
|
|||
|
||||
Cu.import('resource://gre/modules/DownloadsAPI.jsm');
|
||||
|
||||
Cu.import('resource://gre/modules/Webapps.jsm');
|
||||
DOMApplicationRegistry.allAppsLaunchable = true;
|
||||
|
||||
XPCOMUtils.defineLazyServiceGetter(Services, 'env',
|
||||
'@mozilla.org/process/environment;1',
|
||||
'nsIEnvironment');
|
||||
|
@ -268,7 +271,6 @@ var shell = {
|
|||
alert(msg);
|
||||
return;
|
||||
}
|
||||
|
||||
let manifestURL = this.manifestURL;
|
||||
// <html:iframe id="systemapp"
|
||||
// mozbrowser="true" allowfullscreen="true"
|
||||
|
@ -613,9 +615,6 @@ var shell = {
|
|||
|
||||
this.reportCrash(true);
|
||||
|
||||
Cu.import('resource://gre/modules/Webapps.jsm');
|
||||
DOMApplicationRegistry.allAppsLaunchable = true;
|
||||
|
||||
this.sendEvent(window, 'ContentStart');
|
||||
|
||||
Services.obs.notifyObservers(null, 'content-start', null);
|
||||
|
@ -668,13 +667,12 @@ Services.obs.addObserver(function onFullscreenOriginChange(subject, topic, data)
|
|||
fullscreenorigin: data });
|
||||
}, "fullscreen-origin-change", false);
|
||||
|
||||
Services.obs.addObserver(function onWebappsStart(subject, topic, data) {
|
||||
DOMApplicationRegistry.registryStarted.then(function () {
|
||||
shell.sendChromeEvent({ type: 'webapps-registry-start' });
|
||||
}, 'webapps-registry-start', false);
|
||||
|
||||
Services.obs.addObserver(function onWebappsReady(subject, topic, data) {
|
||||
});
|
||||
DOMApplicationRegistry.registryReady.then(function () {
|
||||
shell.sendChromeEvent({ type: 'webapps-registry-ready' });
|
||||
}, 'webapps-registry-ready', false);
|
||||
});
|
||||
|
||||
Services.obs.addObserver(function onBluetoothVolumeChange(subject, topic, data) {
|
||||
shell.sendChromeEvent({
|
||||
|
|
|
@ -241,16 +241,28 @@ this.DOMApplicationRegistry = {
|
|||
},
|
||||
|
||||
// Notify we are starting with registering apps.
|
||||
_registryStarted: Promise.defer(),
|
||||
notifyAppsRegistryStart: function notifyAppsRegistryStart() {
|
||||
Services.obs.notifyObservers(this, "webapps-registry-start", null);
|
||||
this._registryStarted.resolve();
|
||||
},
|
||||
|
||||
get registryStarted() {
|
||||
return this._registryStarted.promise;
|
||||
},
|
||||
|
||||
// Notify we are done with registering apps and save a copy of the registry.
|
||||
_registryReady: Promise.defer(),
|
||||
notifyAppsRegistryReady: function notifyAppsRegistryReady() {
|
||||
this._registryReady.resolve();
|
||||
Services.obs.notifyObservers(this, "webapps-registry-ready", null);
|
||||
this._saveApps();
|
||||
},
|
||||
|
||||
get registryReady() {
|
||||
return this._registryReady.promise;
|
||||
},
|
||||
|
||||
// Ensure that the .to property in redirects is a relative URL.
|
||||
sanitizeRedirects: function sanitizeRedirects(aSource) {
|
||||
if (!aSource) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче