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

Side by Side Diff: chrome/browser/extensions/standard_management_policy_provider.cc

Issue 536753003: Add recommended extension installation support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext-3
Patch Set: add ui changes Created 6 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/extensions/standard_management_policy_provider.h" 5 #include "chrome/browser/extensions/standard_management_policy_provider.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 } 134 }
135 135
136 bool StandardManagementPolicyProvider::MustRemainEnabled( 136 bool StandardManagementPolicyProvider::MustRemainEnabled(
137 const Extension* extension, 137 const Extension* extension,
138 base::string16* error) const { 138 base::string16* error) const {
139 return !AdminPolicyIsModifiable(extension, error) || 139 return !AdminPolicyIsModifiable(extension, error) ||
140 (extension->location() == extensions::Manifest::EXTERNAL_COMPONENT && 140 (extension->location() == extensions::Manifest::EXTERNAL_COMPONENT &&
141 ExternalComponentLoader::IsModifiable(extension)); 141 ExternalComponentLoader::IsModifiable(extension));
142 } 142 }
143 143
144 bool StandardManagementPolicyProvider::MustRemainInstalled(
145 const Extension* extension,
146 base::string16* error) const {
147 if (!UserMayModifySettings(extension, error))
148 return false;
Joao da Silva 2014/09/18 12:21:23 Why? Shouldn't this be true?
binjin 2014/09/18 16:25:15 Done.
149 ExtensionManagement::InstallationMode mode =
150 settings_->ReadById(extension->id()).installation_mode;
151 // Disallowing removing of recommended extension, to avoid re-install it
152 // again while policy is reload. But disabling of recommended extension is
153 // allowed.
154 if (mode == ExtensionManagement::INSTALLATION_FORCED ||
155 mode == ExtensionManagement::INSTALLATION_RECOMMENDED) {
156 if (error) {
157 *error = l10n_util::GetStringFUTF16(
158 IDS_EXTENSION_CANT_UNINSTALL_POLICY_REQUIRED,
159 base::UTF8ToUTF16(extension->name()));
160 }
161 return true;
162 }
163 return false;
164 }
165
144 } // namespace extensions 166 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698