Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(414)

Unified Diff: chrome/browser/extensions/extension_service.cc

Issue 15713003: Supresses app permissions changed dialogs in kiosk mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/usb/usb_service.cc » ('j') | chrome/browser/usb/usb_service.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 6cfddc3a1ae65fd5e3166b31eba1253d8ee50e58..3d1c63a64dbf3367f3729dcdab7c99e25eab901a 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -27,6 +27,7 @@
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "base/version.h"
+#include "chrome/browser/app_mode/app_mode_utils.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/devtools/devtools_window.h"
#include "chrome/browser/extensions/api/app_runtime/app_runtime_api.h"
@@ -2198,18 +2199,21 @@ void ExtensionService::CheckPermissionsIncrease(const Extension* extension,
// can upgrade without requiring this user's approval.
int disable_reasons = extension_prefs_->GetDisableReasons(extension->id());
- bool is_default_app_install =
- (!is_extension_upgrade && extension->was_installed_by_default());
+ bool auto_grant_permission =
+ (!is_extension_upgrade && extension->was_installed_by_default()) ||
+ chrome::IsRunningInForcedAppMode();
// Silently grant all active permissions to default apps only on install.
// After install they should behave like other apps.
- if (is_default_app_install)
+ // Silently grant all active permissions to apps install in kiosk mode on both
+ // install and update.
+ if (auto_grant_permission)
GrantPermissions(extension);
bool is_privilege_increase = false;
// We only need to compare the granted permissions to the current permissions
// if the extension is not allowed to silently increase its permissions.
if (!extensions::PermissionsData::CanSilentlyIncreasePermissions(extension) &&
- !is_default_app_install) {
+ !auto_grant_permission) {
// Add all the recognized permissions if the granted permissions list
// hasn't been initialized yet.
scoped_refptr<PermissionSet> granted_permissions =
« no previous file with comments | « no previous file | chrome/browser/usb/usb_service.cc » ('j') | chrome/browser/usb/usb_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698