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

Unified Diff: chrome/browser/download/download_crx_util.cc

Issue 10266015: Add the --disable-off-store-extension-install switch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixy fix Created 8 years, 8 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
« no previous file with comments | « chrome/browser/download/download_crx_util.h ('k') | chrome/browser/download/download_shelf_context_menu.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_crx_util.cc
diff --git a/chrome/browser/download/download_crx_util.cc b/chrome/browser/download/download_crx_util.cc
index ab242df7db48414c59601f0ceb58e31186fe7d45..4a2d8ac208854ac8890b3700f0c7cd19218a792a 100644
--- a/chrome/browser/download/download_crx_util.cc
+++ b/chrome/browser/download/download_crx_util.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/extensions/webstore_installer.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/extensions/switch_utils.h"
#include "content/public/browser/download_item.h"
#include "content/public/browser/notification_service.h"
@@ -50,6 +51,15 @@ void SetMockInstallUIForTesting(ExtensionInstallUI* mock_ui) {
mock_install_ui_for_testing = mock_ui;
}
+bool ShouldOpenExtensionDownload(const DownloadItem& download_item) {
+ if (extensions::switch_utils::IsOffStoreInstallEnabled() ||
+ WebstoreInstaller::GetAssociatedApproval(download_item)) {
+ return true;
+ } else {
+ return false;
+ }
+}
+
scoped_refptr<CrxInstaller> OpenChromeExtension(
Profile* profile,
const DownloadItem& download_item) {
« no previous file with comments | « chrome/browser/download/download_crx_util.h ('k') | chrome/browser/download/download_shelf_context_menu.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698