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

Unified Diff: chrome/browser/ui/gtk/extensions/extension_installed_bubble_gtk.h

Issue 23461013: Refactor out duplicate code from GTK/Views extension installed bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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/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..00352ca3da3058754200510e442363f5b2f061bc 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::Delegate,
+ 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::Delegate:
+ 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);
};

Powered by Google App Engine
This is Rietveld 408576698