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

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

Issue 10452009: Improve the UI for disabling off-store extension install. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: addressed comments, fixed tests 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/crx_installer.cc
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index 4a26f21d9a734f0fd8bb9fa0d7afe94c786f2bb3..656d069b58c6d2a7218e06c165ea00d3241d3285 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -36,6 +36,7 @@
#include "chrome/common/extensions/extension_constants.h"
#include "chrome/common/extensions/extension_file_util.h"
#include "chrome/common/extensions/extension_icon_set.h"
+#include "chrome/common/extensions/extension_switch_utils.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/resource_dispatcher_host.h"
@@ -189,6 +190,14 @@ bool CrxInstaller::AllowInstall(const Extension* extension,
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
DCHECK(error);
+ if (!extension->is_theme() &&
+ !extensions::switch_utils::IsOffStoreInstallEnabled() &&
+ !is_gallery_install()) {
+ *error = l10n_util::GetStringUTF16(
+ IDS_EXTENSION_INSTALL_DISALLOWED_ON_SITE);
+ return false;
+ }
+
// Make sure the expected ID matches if one was supplied or if we want to
// bypass the prompt.
if ((approved_ || !expected_id_.empty()) &&

Powered by Google App Engine
This is Rietveld 408576698