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

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

Issue 6721013: extensions: Refactor ExtensionInstallUI class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sort gypi 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.h
diff --git a/chrome/browser/ui/webui/app_launcher_handler.h b/chrome/browser/ui/webui/app_launcher_handler.h
index e5622563373f5d0dcc99b8c942caddc6571b0f12..9df3d76be8aac19b4adbcb620584325a693e14f1 100644
--- a/chrome/browser/ui/webui/app_launcher_handler.h
+++ b/chrome/browser/ui/webui/app_launcher_handler.h
@@ -7,6 +7,7 @@
#pragma once
#include "base/scoped_ptr.h"
+#include "chrome/browser/extensions/extension_generic_dialog.h"
#include "chrome/browser/extensions/extension_install_ui.h"
#include "chrome/browser/prefs/pref_change_registrar.h"
#include "chrome/common/extensions/extension.h"
@@ -22,14 +23,14 @@ class PrefChangeRegistrar;
class Profile;
namespace gfx {
- class Rect;
+class Rect;
}
// The handler for Javascript messages related to the "apps" view.
-class AppLauncherHandler
- : public WebUIMessageHandler,
- public ExtensionInstallUI::Delegate,
- public NotificationObserver {
+class AppLauncherHandler : public WebUIMessageHandler,
+ public ExtensionGenericDialog::Delegate,
+ public ExtensionInstallUI::Delegate,
+ public NotificationObserver {
public:
explicit AppLauncherHandler(ExtensionService* extension_service);
virtual ~AppLauncherHandler();
@@ -97,11 +98,18 @@ class AppLauncherHandler
// Prompts the user to re-enable the app for |extension_id|.
void PromptToEnableApp(std::string extension_id);
- // ExtensionInstallUI::Delegate implementation, used for receiving
- // notification about uninstall confirmation dialog selections.
+ // ExtensionGenericDialog::Delegate:
+ virtual void ExtensionDialogAccepted();
+ virtual void ExtensionDialogCanceled();
+
+ // ExtensionInstallUI::Delegate:
virtual void InstallUIProceed();
virtual void InstallUIAbort();
+ // Returns the ExtensionGenericDialog object for this class, creating it if
+ // needed.
+ ExtensionGenericDialog* GetExtensionGenericDialog();
+
// Returns the ExtensionInstallUI object for this class, creating it if
// needed.
ExtensionInstallUI* GetExtensionInstallUI();
@@ -119,15 +127,17 @@ class AppLauncherHandler
// Monitor extension preference changes so that the Web UI can be notified.
PrefChangeRegistrar pref_change_registrar_;
- // Used to show confirmation UI for uninstalling/enabling extensions in
- // incognito mode.
- scoped_ptr<ExtensionInstallUI> install_ui_;
+ // Used to show confirmation UI for uninstalling extensions in incognito mode.
+ scoped_ptr<ExtensionGenericDialog> extension_generic_dialog_;
+
+ // Used to show confirmation UI for enabling extensions in incognito mode.
+ scoped_ptr<ExtensionInstallUI> extension_install_ui_;
// The id of the extension we are prompting the user about.
std::string extension_id_prompting_;
// The type of prompt we are showing the user.
- ExtensionInstallUI::PromptType extension_prompt_type_;
+ bool is_uninstall_dialog_;
// Whether the promo is currently being shown.
bool promo_active_;

Powered by Google App Engine
This is Rietveld 408576698