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

Unified Diff: chrome/browser/ui/webui/app_launcher_handler.cc

Issue 6721013: extensions: Refactor ExtensionInstallUI class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove the file Created 9 years, 9 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/ui/webui/app_launcher_handler.cc
diff --git a/chrome/browser/ui/webui/app_launcher_handler.cc b/chrome/browser/ui/webui/app_launcher_handler.cc
index c9631594a42b2b71f206f7b3d06c9521fda5daa2..75f63b6b255cbedaf03fe56af2a01dd6c5c7f8cb 100644
--- a/chrome/browser/ui/webui/app_launcher_handler.cc
+++ b/chrome/browser/ui/webui/app_launcher_handler.cc
@@ -63,7 +63,7 @@ extension_misc::AppLaunchBucket ParseLaunchSource(std::string launch_source) {
AppLauncherHandler::AppLauncherHandler(ExtensionService* extension_service)
: extensions_service_(extension_service),
- extension_prompt_type_(ExtensionInstallUI::UNSET_PROMPT_TYPE),
+ extension_dialog_type_(ExtensionGenericDialog::DIALOG_UNSET),
promo_active_(false),
ignore_changes_(false) {
}
@@ -406,8 +406,8 @@ void AppLauncherHandler::HandleUninstallApp(const ListValue* args) {
return; // Only one prompt at a time.
extension_id_prompting_ = extension_id;
- extension_prompt_type_ = ExtensionInstallUI::UNINSTALL_PROMPT;
- GetExtensionInstallUI()->ConfirmUninstall(this, extension);
+ extension_dialog_type_ = ExtensionGenericDialog::DIALOG_UNINSTALL;
+ GetExtensionGenericDialog()->ConfirmUninstall(this, extension);
}
void AppLauncherHandler::HandleHideAppsPromo(const ListValue* args) {
@@ -538,11 +538,11 @@ void AppLauncherHandler::PromptToEnableApp(std::string extension_id) {
return; // Only one prompt at a time.
extension_id_prompting_ = extension_id;
- extension_prompt_type_ = ExtensionInstallUI::RE_ENABLE_PROMPT;
- GetExtensionInstallUI()->ConfirmReEnable(this, extension);
+ extension_dialog_type_ = ExtensionGenericDialog::DIALOG_RE_ENABLE;
+ GetExtensionGenericDialog()->ConfirmReenable(this, extension);
}
-void AppLauncherHandler::InstallUIProceed() {
+void AppLauncherHandler::ExtensionDialogAccepted() {
DCHECK(!extension_id_prompting_.empty());
// The extension can be uninstalled in another window while the UI was
@@ -552,12 +552,12 @@ void AppLauncherHandler::InstallUIProceed() {
if (!extension)
return;
- switch (extension_prompt_type_) {
- case ExtensionInstallUI::UNINSTALL_PROMPT:
+ switch (extension_dialog_type_) {
+ case ExtensionGenericDialog::DIALOG_UNINSTALL:
extensions_service_->UninstallExtension(extension_id_prompting_,
false /* external_uninstall */);
break;
- case ExtensionInstallUI::RE_ENABLE_PROMPT: {
+ case ExtensionGenericDialog::DIALOG_RE_ENABLE: {
extensions_service_->GrantPermissionsAndEnableExtension(extension);
// We bounce this off the NTP so the browser can update the apps icon.
@@ -576,14 +576,16 @@ void AppLauncherHandler::InstallUIProceed() {
extension_id_prompting_ = "";
}
-void AppLauncherHandler::InstallUIAbort() {
+void AppLauncherHandler::ExtensionDialogCanceled() {
extension_id_prompting_ = "";
}
-ExtensionInstallUI* AppLauncherHandler::GetExtensionInstallUI() {
- if (!install_ui_.get())
- install_ui_.reset(new ExtensionInstallUI(web_ui_->GetProfile()));
- return install_ui_.get();
+ExtensionGenericDialog* AppLauncherHandler::GetExtensionGenericDialog() {
+ if (!extension_generic_dialog_.get()) {
+ extension_generic_dialog_.reset(
+ new ExtensionGenericDialog(web_ui_->GetProfile()));
+ }
+ return extension_generic_dialog_.get();
}
void AppLauncherHandler::UninstallDefaultApps() {

Powered by Google App Engine
This is Rietveld 408576698