Index: chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.h |
diff --git a/chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.h b/chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.h |
index c721618ec3b78edff640e14e5f2aea0c1682ddea..5a4acc106a7330bc870c343be0d11461e05c0155 100644 |
--- a/chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.h |
+++ b/chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.h |
@@ -7,12 +7,9 @@ |
#include "base/compiler_specific.h" |
#include "base/memory/scoped_ptr.h" |
-#include "base/memory/weak_ptr.h" |
+#include "chrome/browser/ui/extensions/extension_installed_bubble.h" |
#include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" |
#include "chrome/browser/ui/gtk/custom_button.h" |
-#include "content/public/browser/notification_observer.h" |
-#include "content/public/browser/notification_registrar.h" |
-#include "third_party/skia/include/core/SkBitmap.h" |
class Browser; |
class SkBitmap; |
@@ -33,43 +30,30 @@ class Extension; |
// |
// ExtensionInstallBubble manages its own lifetime. |
class ExtensionInstalledBubbleGtk |
- : public BubbleDelegateGtk, |
- public content::NotificationObserver { |
+ : public ExtensionInstalledBubble::View, |
+ public BubbleDelegateGtk { |
public: |
virtual ~ExtensionInstalledBubbleGtk(); |
- // The behavior and content of this BubbleGtk comes in three varieties. |
- enum BubbleType { |
- OMNIBOX_KEYWORD, |
- BROWSER_ACTION, |
- PAGE_ACTION, |
- GENERIC |
- }; |
- |
// Creates the ExtensionInstalledBubble and schedules it to be shown once |
// the extension has loaded. |extension| is the installed extension. |browser| |
// is the browser window which will host the bubble. |icon| is the install |
// icon of the extension. |
static void Show(const extensions::Extension* extension, |
- Browser *browser, |
+ Browser* browser, |
const SkBitmap& icon); |
private: |
- // Private ctor. Registers a listener for EXTENSION_LOADED. |
ExtensionInstalledBubbleGtk(const extensions::Extension* extension, |
- Browser *browser, |
+ Browser* browser, |
const SkBitmap& icon); |
// Notified when the bubble gets destroyed so we can delete our instance. |
CHROMEGTK_CALLBACK_0(ExtensionInstalledBubbleGtk, void, OnDestroy); |
- // Shows the bubble. Called internally via PostTask. |
- void ShowInternal(); |
- |
- // content::NotificationObserver: |
- virtual void Observe(int type, |
- const content::NotificationSource& source, |
- const content::NotificationDetails& details) OVERRIDE; |
+ // ExtensionInstalledBubble::View: |
+ virtual void ShowInternal() OVERRIDE; |
+ virtual void OnBrowserClosing() OVERRIDE; |
// BubbleDelegateGtk: |
virtual void BubbleClosing(BubbleGtk* bubble, bool closed_by_escape) OVERRIDE; |
@@ -80,22 +64,11 @@ class ExtensionInstalledBubbleGtk |
// Link button callbacks. |
CHROMEGTK_CALLBACK_0(ExtensionInstalledBubbleGtk, void, OnLinkClicked); |
- const extensions::Extension* extension_; |
- Browser* browser_; |
- SkBitmap icon_; |
- content::NotificationRegistrar registrar_; |
- BubbleType type_; |
- |
- // The number of times to retry showing the bubble if the browser action |
- // toolbar is animating. |
- int animation_wait_retries_; |
- |
// The 'x' that the user can press to hide the bubble shelf. |
scoped_ptr<CustomDrawButton> close_button_; |
- BubbleGtk* bubble_; |
- |
- base::WeakPtrFactory<ExtensionInstalledBubbleGtk> weak_factory_; |
+ ExtensionInstalledBubble bubble_; |
+ BubbleGtk* gtk_bubble_; |
DISALLOW_COPY_AND_ASSIGN(ExtensionInstalledBubbleGtk); |
}; |