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

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

Issue 11644077: Put extension enable logic into a ExtensionEnableFlow. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase + address comments in #1 Created 7 years, 11 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/ntp/app_launcher_handler.h
diff --git a/chrome/browser/ui/webui/ntp/app_launcher_handler.h b/chrome/browser/ui/webui/ntp/app_launcher_handler.h
index ba8c232fcc84b5b479d786c8bfac3bcd348b7d28..80a419076c8c15f804e328a8d7e93918e974a97d 100644
--- a/chrome/browser/ui/webui/ntp/app_launcher_handler.h
+++ b/chrome/browser/ui/webui/ntp/app_launcher_handler.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_
#define CHROME_BROWSER_UI_WEBUI_NTP_APP_LAUNCHER_HANDLER_H_
+#include <set>
#include <string>
#include "base/memory/scoped_ptr.h"
@@ -12,6 +13,7 @@
#include "chrome/browser/extensions/extension_install_prompt.h"
#include "chrome/browser/extensions/extension_uninstall_dialog.h"
#include "chrome/browser/favicon/favicon_service.h"
+#include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h"
#include "chrome/common/cancelable_task_tracker.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_constants.h"
@@ -20,6 +22,7 @@
#include "content/public/browser/web_ui_message_handler.h"
#include "sync/api/string_ordinal.h"
+class ExtensionEnableFlow;
class ExtensionService;
class PrefChangeRegistrar;
class PrefServiceSyncable;
@@ -32,7 +35,7 @@ class AppNotification;
// The handler for Javascript messages related to the "apps" view.
class AppLauncherHandler : public content::WebUIMessageHandler,
public ExtensionUninstallDialog::Delegate,
- public ExtensionInstallPrompt::Delegate,
+ public ExtensionEnableFlowDelegate,
public content::NotificationObserver {
public:
explicit AppLauncherHandler(ExtensionService* extension_service);
@@ -142,18 +145,15 @@ class AppLauncherHandler : public content::WebUIMessageHandler,
virtual void ExtensionUninstallAccepted() OVERRIDE;
virtual void ExtensionUninstallCanceled() OVERRIDE;
- // ExtensionInstallPrompt::Delegate:
- virtual void InstallUIProceed() OVERRIDE;
- virtual void InstallUIAbort(bool user_initiated) OVERRIDE;
+ // ExtensionEnableFlowDelegate:
+ virtual ExtensionInstallPrompt* CreateExtensionInstallPrompt() OVERRIDE;
+ virtual void ExtensionEnableFlowFinished() OVERRIDE;
+ virtual void ExtensionEnableFlowAborted(bool user_initiated) OVERRIDE;
// Returns the ExtensionUninstallDialog object for this class, creating it if
// needed.
ExtensionUninstallDialog* GetExtensionUninstallDialog();
- // Returns the ExtensionInstallPrompt object for this class, creating it if
- // needed.
- ExtensionInstallPrompt* GetExtensionInstallPrompt();
-
// Continuation for installing a bookmark app after favicon lookup.
void OnFaviconForApp(scoped_ptr<AppInstallInfo> install_info,
const history::FaviconImageResult& image_result);
@@ -177,13 +177,14 @@ class AppLauncherHandler : public content::WebUIMessageHandler,
// Used to show confirmation UI for uninstalling extensions in incognito mode.
scoped_ptr<ExtensionUninstallDialog> extension_uninstall_dialog_;
- // Used to show confirmation UI for enabling extensions in incognito mode.
- scoped_ptr<ExtensionInstallPrompt> extension_install_ui_;
+ // Used to show confirmation UI for enabling extensions.
+ scoped_ptr<ExtensionEnableFlow> extension_enable_flow_;
// The ids of apps to show on the NTP.
std::set<std::string> visible_apps_;
- // The id of the extension we are prompting the user about.
+ // The id of the extension we are prompting the user about (either enable or
+ // uninstall).
std::string extension_id_prompting_;
// When true, we ignore changes to the underlying data rather than immediately
« no previous file with comments | « chrome/browser/ui/extensions/extension_enable_flow_delegate.h ('k') | chrome/browser/ui/webui/ntp/app_launcher_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698