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

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

Issue 9694038: OBSOLETE REVIEW. See http://codereview.chromium.org/10382149/ (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/extensions/extension_prefs.cc
===================================================================
--- chrome/browser/extensions/extension_prefs.cc (revision 136836)
+++ chrome/browser/extensions/extension_prefs.cc (working copy)
@@ -20,6 +20,8 @@
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "content/public/browser/notification_service.h"
+#include "grit/generated_resources.h"
+#include "ui/base/l10n/l10n_util.h"
namespace {
@@ -651,15 +653,14 @@
Value::CreateBooleanValue(value));
}
-bool ExtensionPrefs::IsExtensionAllowedByPolicy(
- const std::string& extension_id,
- Extension::Location location) const {
+bool ExtensionPrefs::UserMayInstall(const std::string& extension_id,
+ Extension::Location location,
+ const std::string& extension_name,
+ string16* error) const {
base::StringValue id_value(extension_id);
- if (location == Extension::COMPONENT ||
- location == Extension::EXTERNAL_POLICY_DOWNLOAD) {
+ if (Extension::IsRequired(location))
Aaron Boodman 2012/05/17 22:41:06 I don't see any Extension::IsRequired. What's this
Pam (message me for reviews) 2012/05/18 20:15:15 It's a rename (and direction flip) of Extension::U
return true;
- }
const base::ListValue* blacklist =
prefs_->GetList(prefs::kExtensionInstallDenyList);
@@ -673,8 +674,15 @@
return true;
// Then check the blacklist (the admin blacklist, not the Google blacklist).
- return blacklist->Find(id_value) == blacklist->end() &&
- !ExtensionsBlacklistedByDefault();
+ bool result = blacklist->Find(id_value) == blacklist->end() &&
+ !ExtensionsBlacklistedByDefault();
+ if (error && !result) {
+ *error = l10n_util::GetStringFUTF16(
+ IDS_EXTENSION_CANT_INSTALL_POLICY_BLACKLIST,
+ UTF8ToUTF16(extension_name),
+ UTF8ToUTF16(extension_id));
+ }
+ return result;
}
bool ExtensionPrefs::ExtensionsBlacklistedByDefault() const {

Powered by Google App Engine
This is Rietveld 408576698