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

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: Rebased Created 8 years, 4 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..7c9de2a28d857a35100c6148655aca8262b88d74 100644
--- a/chrome/browser/ui/views/location_bar/zoom_bubble_view.h
+++ b/chrome/browser/ui/views/location_bar/zoom_bubble_view.h
@@ -9,31 +9,53 @@
#include "base/timer.h"
#include "ui/views/bubble/bubble_delegate.h"
#include "ui/views/controls/button/button.h"
+#include "ui/views/controls/button/text_button.h"
#include "ui/views/controls/label.h"
+#include "ui/views/events/event.h"
+
+class TabContents;
// View used to display the zoom percentage when it has changed.
-class ZoomBubbleView : public views::BubbleDelegateView {
+class ZoomBubbleView : public views::BubbleDelegateView,
+ public views::ButtonListener {
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();
+ // Starts a timer which will close the bubble if |auto_close_| is true.
+ void StartTimerIfNecessary();
+
+ // Stops the auto-close timer.
+ void StopTimer();
+
+ // views::View method.
+ virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE;
+ virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE;
+
+ // views::ButtonListener method.
+ virtual void ButtonPressed(views::Button* sender,
+ const views::Event& event) OVERRIDE;
+
// views::BubbleDelegateView method.
virtual void Init() OVERRIDE;
-
- // views::BubbleDelegateView:
+ virtual gfx::Rect GetAnchorRect() OVERRIDE;
virtual void WindowClosing() OVERRIDE;
// Singleton instance of the zoom bubble. The zoom bubble can only be shown on
@@ -47,8 +69,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