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

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: Updated a comment. 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..0ca316154547c0f840ada222addcae32990545f4 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();
+
+ // ButtonListener method.
tfarina 2012/07/17 05:57:56 nit: views::ButtonListener
Kyle Horimoto 2012/07/17 18:26:23 Done.
+ virtual void ButtonPressed(views::Button* sender,
tfarina 2012/07/17 05:57:56 can you move this declaration right after the Clos
Kyle Horimoto 2012/07/17 18:26:23 Done.
+ const views::Event& event) OVERRIDE;
+
void Close();
// 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_;
« no previous file with comments | « chrome/browser/ui/views/location_bar/location_bar_view.cc ('k') | chrome/browser/ui/views/location_bar/zoom_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698