зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 5f20ab3487db (bug 697309)
This commit is contained in:
Родитель
f794542618
Коммит
34f8767bf8
|
@ -236,7 +236,6 @@ var BrowserApp = {
|
|||
CharacterEncoding.init();
|
||||
SearchEngines.init();
|
||||
ActivityObserver.init();
|
||||
WebappsUI.init();
|
||||
|
||||
// Init LoginManager
|
||||
Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
|
||||
|
@ -416,7 +415,6 @@ var BrowserApp = {
|
|||
ConsoleAPI.uninit();
|
||||
CharacterEncoding.uninit();
|
||||
SearchEngines.uninit();
|
||||
WebappsUI.uninit();
|
||||
},
|
||||
|
||||
// This function returns false during periods where the browser displayed document is
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
<script type="application/javascript" src="chrome://browser/content/downloads.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/exceptions.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/sanitize.js"/>
|
||||
<script type="application/javascript" src="chrome://browser/content/webapps.js"/>
|
||||
|
||||
<deck id="browsers" flex="1"/>
|
||||
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
||||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
Cu.import("resource://gre/modules/Webapps.jsm");
|
||||
|
||||
let WebappsUI = {
|
||||
init: function() {
|
||||
Services.obs.addObserver(this, "webapps-ask-install", false);
|
||||
Services.obs.addObserver(this, "webapps-launch", false);
|
||||
},
|
||||
|
||||
uninit: function() {
|
||||
Services.obs.removeObserver(this, "webapps-ask-install");
|
||||
Services.obs.removeObserver(this, "webapps-launch");
|
||||
},
|
||||
|
||||
observe: function(aSubject, aTopic, aData) {
|
||||
let data = JSON.parse(aData);
|
||||
switch (aTopic) {
|
||||
case "webapps-ask-install":
|
||||
this.doInstall(data);
|
||||
break;
|
||||
case "webapps-launch":
|
||||
DOMApplicationRegistry.getManifestFor(data.origin, (function(aManifest) {
|
||||
if (!aManifest)
|
||||
return;
|
||||
let manifest = new DOMApplicationManifest(aManifest, data.origin);
|
||||
this.openURL(manifest.fullLaunchPath(), data.origin);
|
||||
}).bind(this));
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
doInstall: function(aData) {
|
||||
let manifest = new DOMApplicationManifest(aData.app.manifest, aData.app.origin);
|
||||
let checkbox = { value: false };
|
||||
let name = manifest.name ? manifest.name : manifest.fullLaunchPath();
|
||||
if (Services.prompt.confirm(null, Strings.browser.GetStringFromName("webapps.installTitle"), name))
|
||||
DOMApplicationRegistry.confirmInstall(aData);
|
||||
},
|
||||
|
||||
openURL: function(aURI, aOrigin) {
|
||||
let ss = Cc["@mozilla.org/browser/sessionstore;1"].getService(Ci.nsISessionStore);
|
||||
|
||||
let tabs = BrowserApp.tabs;
|
||||
let tab = null;
|
||||
for (let i = 0; i < tabs.length; i++) {
|
||||
let appOrigin = ss.getTabValue(tabs[i], "appOrigin");
|
||||
if (appOrigin == aOrigin)
|
||||
tab = tabs[i];
|
||||
}
|
||||
|
||||
if (tab) {
|
||||
BrowserApp.selectTab(tab);
|
||||
} else {
|
||||
tab = BrowserApp.addTab(aURI);
|
||||
ss.setTabValue(tab, "appOrigin", aOrigin);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -26,8 +26,7 @@ chrome.jar:
|
|||
* content/downloads.js (content/downloads.js)
|
||||
content/netError.xhtml (content/netError.xhtml)
|
||||
content/SelectHelper.js (content/SelectHelper.js)
|
||||
content/webapps.js (content/webapps.js)
|
||||
|
||||
|
||||
% override chrome://global/content/config.xul chrome://browser/content/config.xhtml
|
||||
% override chrome://global/content/netError.xhtml chrome://browser/content/netError.xhtml
|
||||
% override chrome://mozapps/content/extensions/extensions.xul chrome://browser/content/aboutAddons.xhtml
|
||||
|
|
|
@ -150,7 +150,6 @@
|
|||
@BINPATH@/components/directory.xpt
|
||||
@BINPATH@/components/docshell.xpt
|
||||
@BINPATH@/components/dom.xpt
|
||||
@BINPATH@/components/dom_apps.xpt
|
||||
@BINPATH@/components/dom_base.xpt
|
||||
@BINPATH@/components/dom_battery.xpt
|
||||
@BINPATH@/components/dom_canvas.xpt
|
||||
|
@ -285,6 +284,7 @@
|
|||
@BINPATH@/components/xuldoc.xpt
|
||||
@BINPATH@/components/xultmpl.xpt
|
||||
@BINPATH@/components/zipwriter.xpt
|
||||
@BINPATH@/components/openwebapps.xpt
|
||||
|
||||
; JavaScript components
|
||||
@BINPATH@/components/ConsoleAPI.manifest
|
||||
|
@ -338,6 +338,7 @@
|
|||
@BINPATH@/components/amContentHandler.js
|
||||
@BINPATH@/components/amWebInstallListener.js
|
||||
@BINPATH@/components/nsBlocklistService.js
|
||||
@BINPATH@/components/OpenWebapps.manifest
|
||||
|
||||
#ifdef MOZ_UPDATER
|
||||
@BINPATH@/components/nsUpdateService.manifest
|
||||
|
@ -410,8 +411,6 @@
|
|||
#endif
|
||||
@BINPATH@/components/TelemetryPing.js
|
||||
@BINPATH@/components/TelemetryPing.manifest
|
||||
@BINPATH@/components/Webapps.js
|
||||
@BINPATH@/components/Webapps.manifest
|
||||
|
||||
; Modules
|
||||
@BINPATH@/modules/*
|
||||
|
@ -614,6 +613,7 @@ bin/components/@DLL_PREFIX@nkgnomevfs@DLL_SUFFIX@
|
|||
@BINPATH@/components/PromptService.js
|
||||
@BINPATH@/components/SessionStore.js
|
||||
@BINPATH@/components/Sidebar.js
|
||||
@BINPATH@/components/OpenWebapps.js
|
||||
#ifdef MOZ_SAFE_BROWSING
|
||||
@BINPATH@/components/SafeBrowsing.js
|
||||
#endif
|
||||
|
|
|
@ -225,9 +225,6 @@ timer.start=%S: timer started
|
|||
# %1$S=name of timer, %2$S=number of milliseconds
|
||||
timer.end=%1$S: %2$Sms
|
||||
|
||||
#Webapps
|
||||
webapps.installTitle=Install Application
|
||||
|
||||
# Click to play plugins
|
||||
clickToPlayPlugins.message1=%S contains plugin content. Would you like to play it?
|
||||
clickToPlayPlugins.yes=Yes
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
<!ENTITY webapps.title.placeholder "Enter a title">
|
||||
<!ENTITY webapps.permissions "Allow access:">
|
||||
<!ENTITY webapps.perm.geolocation "Location-aware browsing">
|
||||
<!ENTITY webapps.perm.offline "Offline data storage">
|
||||
<!ENTITY webapps.perm.notifications "Desktop notifications">
|
||||
<!ENTITY webapps.perm.requestedHint "(requested)">
|
||||
<!ENTITY webapps.add-homescreen "Add to home screen">
|
|
@ -16,5 +16,6 @@
|
|||
locale/@AB_CD@/browser/sync.dtd (%chrome/sync.dtd)
|
||||
locale/@AB_CD@/browser/sync.properties (%chrome/sync.properties)
|
||||
locale/@AB_CD@/browser/prompt.dtd (%chrome/prompt.dtd)
|
||||
locale/@AB_CD@/browser/webapps.dtd (%chrome/webapps.dtd)
|
||||
locale/@AB_CD@/browser/feedback.dtd (%chrome/feedback.dtd)
|
||||
locale/@AB_CD@/browser/phishing.dtd (%chrome/phishing.dtd)
|
||||
|
|
Загрузка…
Ссылка в новой задаче