Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/zoom_bubble_view.h |
| diff --git a/chrome/browser/ui/views/location_bar/zoom_bubble_view.h b/chrome/browser/ui/views/location_bar/zoom_bubble_view.h |
| index cc5437229ea2ddf91a3f7fa4712c8df26c7bd86a..54e3b9d7aad2c7a163419a1a7ef1bf95f912efad 100644 |
| --- a/chrome/browser/ui/views/location_bar/zoom_bubble_view.h |
| +++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.h |
| @@ -7,11 +7,13 @@ |
| #include "base/basictypes.h" |
| #include "base/timer/timer.h" |
| +#include "chrome/browser/extensions/extension_icon_image.h" |
| #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
| #include "content/public/browser/notification_observer.h" |
| #include "content/public/browser/notification_registrar.h" |
| #include "ui/views/bubble/bubble_delegate.h" |
| #include "ui/views/controls/button/button.h" |
| +#include "ui/views/controls/button/image_button.h" |
|
Devlin
2014/06/16 19:04:49
Why do you need the full include?
wjmaclean
2014/06/18 19:03:54
Done.
|
| #include "ui/views/controls/label.h" |
| class FullscreenController; |
| @@ -26,7 +28,8 @@ class WebContents; |
| class ZoomBubbleView : public views::BubbleDelegateView, |
| public views::ButtonListener, |
| public content::NotificationObserver, |
| - public ImmersiveModeController::Observer { |
| + public ImmersiveModeController::Observer, |
| + public extensions::IconImage::Observer { |
| public: |
| // Shows the bubble and automatically closes it after a short time period if |
| // |auto_close| is true. |
| @@ -63,12 +66,21 @@ class ZoomBubbleView : public views::BubbleDelegateView, |
| void Close(); |
| + // Sets information about the extension that initiated the zoom change. |
| + // Calling this method asserts that the extension |extension| did initiate |
| + // the zoom change. |
| + void SetExtensionInfo(const extensions::Extension* extension); |
| + |
| // Starts a timer which will close the bubble if |auto_close_| is true. |
| void StartTimerIfNecessary(); |
| // Stops the auto-close timer. |
| void StopTimer(); |
| + // extensions::IconImage::Observer overrides: |
| + virtual void OnExtensionIconImageChanged( |
| + extensions::IconImage* image) OVERRIDE; |
| + |
| // views::View methods. |
| virtual void OnMouseEntered(const ui::MouseEvent& event) OVERRIDE; |
| virtual void OnMouseExited(const ui::MouseEvent& event) OVERRIDE; |
| @@ -93,6 +105,25 @@ class ZoomBubbleView : public views::BubbleDelegateView, |
| virtual void OnImmersiveRevealStarted() OVERRIDE; |
| virtual void OnImmersiveModeControllerDestroyed() OVERRIDE; |
| + // Stores information about the extension that initiated the zoom change, if |
| + // any. |
| + struct ExtensionInfo { |
|
Devlin
2014/06/16 19:04:49
Appropriate name, but please don't add another Ext
wjmaclean
2014/06/18 19:03:54
Done.
Let me know if the new name, "ZoomBubbleExt
|
| + ExtensionInfo(); |
| + ~ExtensionInfo(); |
| + |
| + // The unique id of the extension, which is used to find the correct |
| + // extension after clicking on the image button in the zoom bubble. |
| + std::string id; |
| + |
| + // The name of the extension, which appears in the tooltip of the image |
| + // button in the zoom bubble. |
| + std::string name; |
| + |
| + // An image of the extension's icon, which appears in the zoom bubble as an |
| + // image button. |
| + scoped_ptr<const extensions::IconImage> icon_image; |
| + } extension_info_; |
|
Devlin
2014/06/16 19:04:49
We don't usually do struct declarations like this.
wjmaclean
2014/06/18 19:03:54
Done.
|
| + |
| // Singleton instance of the zoom bubble. The zoom bubble can only be shown on |
| // the active browser window, so there is no case in which it will be shown |
| // twice at the same time. |
| @@ -101,6 +132,11 @@ class ZoomBubbleView : public views::BubbleDelegateView, |
| // Timer used to close the bubble when |auto_close_| is true. |
| base::OneShotTimer<ZoomBubbleView> timer_; |
| + // Image button in the zoom bubble that will show the |extension_icon_| image |
| + // if an extension initiated the zoom change, and links to that extension at |
| + // "chrome://extensions". |
| + views::ImageButton* image_button_; |
| + |
| // Label displaying the zoom percentage. |
| views::Label* label_; |