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

Unified Diff: chrome/browser/ui/views/location_bar/zoom_bubble_view.h

Issue 10792020: Implements the "Set to default" button on the zoom bubble. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressed tfarina's comments Created 8 years, 5 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/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 57eeda8fd639e69545a2bdd774d2e88c7eeaa3b8..cc91d217650bfd352795c2ff68fb5bff32e42f6c 100644
--- a/chrome/browser/ui/views/location_bar/zoom_bubble_view.h
+++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.h
@@ -11,29 +11,40 @@
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/label.h"
+class TabContents;
+
// View used to display the zoom percentage when it has changed.
-class ZoomBubbleView : public views::BubbleDelegateView {
+class ZoomBubbleView : public views::ButtonListener,
+ public views::BubbleDelegateView {
public:
// Shows the bubble and automatically closes it after a short time period if
// |auto_close| is true.
static void ShowBubble(views::View* anchor_view,
- int zoom_percent,
+ TabContents* tab_contents,
bool auto_close);
static void CloseBubble();
static bool IsShowing();
private:
ZoomBubbleView(views::View* anchor_view,
- int zoom_percent,
+ TabContents* tab_contents,
bool auto_close);
virtual ~ZoomBubbleView();
+ // Refreshes the bubble by changing the zoom percentage appropriately and
+ // resetting the timer if necessary.
+ void Refresh();
+
void Close();
+ // views::ButtonListener method.
+ virtual void ButtonPressed(views::Button* sender,
+ const views::Event& event) OVERRIDE;
+
// views::BubbleDelegateView method.
virtual void Init() OVERRIDE;
- // views::BubbleDelegateView:
+ // views::BubbleDelegateView method.
virtual void WindowClosing() OVERRIDE;
// Singleton instance of the zoom bubble. The zoom bubble can only be shown on
@@ -47,8 +58,8 @@ class ZoomBubbleView : public views::BubbleDelegateView {
// Label displaying the zoom percentage.
views::Label* label_;
- // The zoom percentage to show in the bubble.
- int zoom_percent_;
+ // The TabContents for the page whose zoom has changed.
+ TabContents* tab_contents_;
// Whether the currently displayed bubble will automatically close.
bool auto_close_;

Powered by Google App Engine
This is Rietveld 408576698