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

Unified Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 10382149: Refactor the various ways to control what users can do to extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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
Index: chrome/browser/ui/webui/ntp/app_launcher_handler.cc
===================================================================
--- chrome/browser/ui/webui/ntp/app_launcher_handler.cc (revision 140193)
+++ chrome/browser/ui/webui/ntp/app_launcher_handler.cc (working copy)
@@ -24,6 +24,7 @@
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_sorting.h"
+#include "chrome/browser/extensions/extension_system.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/prefs/scoped_user_pref_update.h"
#include "chrome/browser/profiles/profile.h"
@@ -114,6 +115,10 @@
!service->GetTerminatedExtension(extension->id());
extension->GetBasicInfo(enabled, value);
+ value->SetBoolean("mayDisable", ExtensionSystem::Get(
+ service->profile())->management_policy()->UserMayModifySettings(
+ extension, NULL));
+
bool icon_big_exists = true;
// Instead of setting grayscale here, we do it in apps_page.js.
GURL icon_big =
@@ -605,7 +610,8 @@
if (!extension)
return;
- if (!Extension::UserMayDisable(extension->location())) {
+ if (!ExtensionSystem::Get(extension_service_->profile())->
+ management_policy()->UserMayModifySettings(extension, NULL)) {
LOG(ERROR) << "Attempt to uninstall an extension that is non-usermanagable "
<< "was made. Extension id : " << extension->id();
return;
« no previous file with comments | « chrome/browser/ui/webui/extensions/extension_settings_handler.cc ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698