summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui/app_launcher_handler.h
diff options
context:
space:
mode:
authoraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 22:04:28 +0000
committeraa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-10 22:04:28 +0000
commit121cd7b957d4ed22f861a22783de788703bcaf7c (patch)
treec8a391f2c463a0321b7cb2efd61f9760fca51249 /chrome/browser/dom_ui/app_launcher_handler.h
parenta850ba49a28734c8660e04c52449a3b770a04d1b (diff)
downloadchromium_src-121cd7b957d4ed22f861a22783de788703bcaf7c.zip
chromium_src-121cd7b957d4ed22f861a22783de788703bcaf7c.tar.gz
chromium_src-121cd7b957d4ed22f861a22783de788703bcaf7c.tar.bz2
Add a confirmation prompt to app uninstallation on the ntp.
The uninstall dialog used to say: [===============================x] |Confirm Uninstallation | |--------------------------------| |<b>Uninstall Foo Extension?</b> | | | |Are you sure you want to | |uninstall this extension? | | | |================================| We don't have the bottom string with the word 'app', and I realized it is somewhat extraneous anyway. So just removed it in all cases and de-bolded the text above. Looks much better. Also, fixed a bug where the icon we display in the GTK dialogs is too big by doing image resizing in ExtensionInstallUI. BUG=54874 TEST=Uninstall app and extension. Both should have a prompt, and UI layout should be the same. Review URL: http://codereview.chromium.org/3332016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@59157 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/dom_ui/app_launcher_handler.h')
-rw-r--r--chrome/browser/dom_ui/app_launcher_handler.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/chrome/browser/dom_ui/app_launcher_handler.h b/chrome/browser/dom_ui/app_launcher_handler.h
index 7e89bb7..6a2954a 100644
--- a/chrome/browser/dom_ui/app_launcher_handler.h
+++ b/chrome/browser/dom_ui/app_launcher_handler.h
@@ -6,7 +6,9 @@
#define CHROME_BROWSER_DOM_UI_APP_LAUNCHER_HANDLER_H_
#pragma once
+#include "base/scoped_ptr.h"
#include "chrome/browser/dom_ui/dom_ui.h"
+#include "chrome/browser/extensions/extension_install_ui.h"
#include "chrome/common/notification_observer.h"
#include "chrome/common/notification_registrar.h"
@@ -20,6 +22,7 @@ namespace gfx {
// The handler for Javascript messages related to the "apps" view.
class AppLauncherHandler
: public DOMMessageHandler,
+ public ExtensionInstallUI::Delegate,
public NotificationObserver {
public:
explicit AppLauncherHandler(ExtensionsService* extension_service);
@@ -47,6 +50,15 @@ class AppLauncherHandler
void HandleUninstallApp(const ListValue* args);
private:
+ // ExtensionInstallUI::Delegate implementation, used for receiving
+ // notification about uninstall confirmation dialog selections.
+ virtual void InstallUIProceed(bool create_app_shortcut);
+ virtual void InstallUIAbort();
+
+ // Returns the ExtensionInstallUI object for this class, creating it if
+ // needed.
+ ExtensionInstallUI* GetExtensionInstallUI();
+
// Starts the animation of the app icon.
void AnimateAppIcon(Extension* extension, const gfx::Rect& rect);
@@ -57,6 +69,13 @@ class AppLauncherHandler
// when necessary.
NotificationRegistrar registrar_;
+ // Used to show confirmation UI for uninstalling/enabling extensions in
+ // incognito mode.
+ scoped_ptr<ExtensionInstallUI> install_ui_;
+
+ // The id of the extension we are prompting the user about.
+ std::string extension_id_prompting_;
+
DISALLOW_COPY_AND_ASSIGN(AppLauncherHandler);
};