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

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

Issue 10388252: Refactoring ExtenionInstallUI to abstract the Browser references. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Synced + mac fix Created 8 years, 6 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/download/download_crx_util.cc
diff --git a/chrome/browser/download/download_crx_util.cc b/chrome/browser/download/download_crx_util.cc
index b019f82a2b9e2f20cd131378c675b5a36c5f0d71..08f8d2e04fb7cffef98c62baa67e0940c10f9f38 100644
--- a/chrome/browser/download/download_crx_util.cc
+++ b/chrome/browser/download/download_crx_util.cc
@@ -6,7 +6,7 @@
#include "chrome/browser/download/download_util.h"
#include "chrome/browser/extensions/crx_installer.h"
-#include "chrome/browser/extensions/extension_install_ui.h"
+#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/webstore_installer.h"
#include "chrome/browser/profiles/profile.h"
@@ -22,22 +22,22 @@ namespace download_crx_util {
namespace {
-// Hold a mock ExtensionInstallUI object that will be used when the
+// Hold a mock ExtensionInstallPrompt object that will be used when the
// download system opens a CRX.
-ExtensionInstallUI* mock_install_ui_for_testing = NULL;
+ExtensionInstallPrompt* mock_install_prompt_for_testing = NULL;
// Called to get an extension install UI object. In tests, will return
// a mock if the test calls download_util::SetMockInstallUIForTesting()
// to set one.
-ExtensionInstallUI* CreateExtensionInstallUI(Profile* profile) {
+ExtensionInstallPrompt* CreateExtensionInstallPrompt(Profile* profile) {
// Use a mock if one is present. Otherwise, create a real extensions
// install UI.
- ExtensionInstallUI* result = NULL;
- if (mock_install_ui_for_testing) {
- result = mock_install_ui_for_testing;
- mock_install_ui_for_testing = NULL;
+ ExtensionInstallPrompt* result = NULL;
+ if (mock_install_prompt_for_testing) {
+ result = mock_install_prompt_for_testing;
+ mock_install_prompt_for_testing = NULL;
} else {
- result = new ExtensionInstallUI(profile);
+ result = new ExtensionInstallPrompt(profile);
}
return result;
@@ -45,10 +45,10 @@ ExtensionInstallUI* CreateExtensionInstallUI(Profile* profile) {
} // namespace
-// Tests can call this method to inject a mock ExtensionInstallUI
+// Tests can call this method to inject a mock ExtensionInstallPrompt
// to be used to confirm permissions on a downloaded CRX.
-void SetMockInstallUIForTesting(ExtensionInstallUI* mock_ui) {
- mock_install_ui_for_testing = mock_ui;
+void SetMockInstallPromptForTesting(ExtensionInstallPrompt* mock_prompt) {
+ mock_install_prompt_for_testing = mock_prompt;
}
scoped_refptr<CrxInstaller> OpenChromeExtension(
@@ -62,7 +62,7 @@ scoped_refptr<CrxInstaller> OpenChromeExtension(
scoped_refptr<CrxInstaller> installer(
CrxInstaller::Create(
service,
- CreateExtensionInstallUI(profile),
+ CreateExtensionInstallPrompt(profile),
WebstoreInstaller::GetAssociatedApproval(download_item)));
installer->set_delete_source(true);
« no previous file with comments | « chrome/browser/download/download_crx_util.h ('k') | chrome/browser/extensions/api/permissions/permissions_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698