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

Side by Side Diff: chrome/browser/download/download_crx_util.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 // Download code which handles CRX files (extensions, themes, apps, ...). 5 // Download code which handles CRX files (extensions, themes, apps, ...).
6 6
7 #include "chrome/browser/download/download_util.h" 7 #include "chrome/browser/download/download_util.h"
8 #include "chrome/browser/extensions/crx_installer.h" 8 #include "chrome/browser/extensions/crx_installer.h"
9 #include "chrome/browser/extensions/extension_install_ui.h" 9 #include "chrome/browser/extensions/extension_install_ui.h"
10 #include "chrome/browser/extensions/extension_service.h" 10 #include "chrome/browser/extensions/extension_service.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 if (is_gallery_download) 80 if (is_gallery_download)
81 installer->set_original_download_url(download_item.GetOriginalUrl()); 81 installer->set_original_download_url(download_item.GetOriginalUrl());
82 installer->set_allow_silent_install(is_gallery_download); 82 installer->set_allow_silent_install(is_gallery_download);
83 installer->set_install_cause(extension_misc::INSTALL_CAUSE_USER_DOWNLOAD); 83 installer->set_install_cause(extension_misc::INSTALL_CAUSE_USER_DOWNLOAD);
84 installer->InstallCrx(download_item.GetFullPath()); 84 installer->InstallCrx(download_item.GetFullPath());
85 } 85 }
86 86
87 return installer; 87 return installer;
88 } 88 }
89 89
90 bool IsExtensionDownload(const DownloadItem& download_item) {
91 if (download_item.PromptUserForSaveLocation())
92 return false;
93
94 if (download_item.GetMimeType() == extensions::Extension::kMimeType ||
95 UserScript::IsURLUserScript(download_item.GetURL(),
96 download_item.GetMimeType())) {
97 return true;
98 } else {
99 return false;
100 }
101 }
102
90 } // namespace download_crx_util 103 } // namespace download_crx_util
OLDNEW
« no previous file with comments | « chrome/browser/download/download_crx_util.h ('k') | chrome/browser/download/download_history.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698