mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
Bug 1046885 - Disable installing webapps in guest mode profiles. r=myk
This commit is contained in:
parent
e126ede3c2
commit
d2c853240d
@ -2517,6 +2517,9 @@ public class BrowserApp extends GeckoApp
|
||||
final boolean inGuestMode = GeckoProfile.get(this).inGuestMode();
|
||||
share.setVisible(!inGuestMode);
|
||||
share.setEnabled(StringUtils.isShareableUrl(url) && !inGuestMode);
|
||||
MenuUtils.safeSetEnabled(aMenu, R.id.apps, !inGuestMode);
|
||||
MenuUtils.safeSetEnabled(aMenu, R.id.addons, !inGuestMode);
|
||||
MenuUtils.safeSetEnabled(aMenu, R.id.downloads, !inGuestMode);
|
||||
|
||||
// NOTE: Use MenuUtils.safeSetEnabled because some actions might
|
||||
// be on the BrowserToolbar context menu
|
||||
|
@ -55,3 +55,5 @@ retrievalFailedTitle=#1 update failed;#1 updates failed
|
||||
# %1$S is a comma-separated list of apps for which retrieval failed.
|
||||
# example: Failed to retrieve updates for Foo, Bar, Baz
|
||||
retrievalFailedMessage=Failed to retrieve update for %1$S;Failed to retrieve updates for %1$S
|
||||
|
||||
webappsDisabledInGuest=Installing apps is disabled in guest sessions
|
||||
|
@ -89,6 +89,12 @@ this.WebappManager = {
|
||||
},
|
||||
|
||||
_installApk: function(aMessage, aMessageManager) { return Task.spawn((function*() {
|
||||
if (this.inGuestSession()) {
|
||||
aMessage.error = Strings.GetStringFromName("webappsDisabledInGuest"),
|
||||
aMessageManager.sendAsyncMessage("Webapps:Install:Return:KO", aMessage);
|
||||
return;
|
||||
}
|
||||
|
||||
let filePath;
|
||||
|
||||
try {
|
||||
@ -251,6 +257,10 @@ this.WebappManager = {
|
||||
|
||||
}),
|
||||
|
||||
inGuestSession: function() {
|
||||
return Services.wm.getMostRecentWindow("navigator:browser").BrowserApp.isGuest;
|
||||
},
|
||||
|
||||
autoInstall: function(aData) {
|
||||
debug("autoInstall " + aData.manifestURL);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user