| 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()) &&
|
|
|