Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_BUBBLE_VIEW_H_ | |
| 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_BUBBLE_VIEW_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/memory/weak_ptr.h" | |
| 10 #include "ui/views/bubble/bubble_delegate.h" | |
| 11 #include "ui/views/controls/button/button.h" | |
| 12 #include "ui/views/controls/label.h" | |
| 13 | |
| 14 // View used to display the zoom percentage when it has changed. | |
| 15 class ZoomBubbleView : public views::BubbleDelegateView { | |
| 16 public: | |
| 17 // Shows the bubble and automatically closes it after a short time period if | |
| 18 // |auto_close| is true. | |
| 19 static void ShowBubble(views::View* anchor_view, | |
| 20 int zoom_percent, | |
| 21 bool auto_close); | |
| 22 static void CloseBubble(); | |
| 23 static bool IsShowing(); | |
| 24 | |
| 25 // views::WidgetDelegate method. | |
|
Peter Kasting
2012/06/22 20:16:20
Nit: Since this doesn't inherit directly from view
Kyle Horimoto
2012/06/26 21:55:53
Done.
| |
| 26 virtual void WindowClosing() OVERRIDE; | |
| 27 | |
| 28 protected: | |
| 29 // views::BubbleDelegateView method. | |
| 30 virtual void Init() OVERRIDE; | |
|
Peter Kasting
2012/06/22 20:16:20
Nit: No one overrides this class, right? So this
Kyle Horimoto
2012/06/26 21:55:53
Done.
| |
| 31 | |
| 32 private: | |
| 33 ZoomBubbleView(views::View* anchor_view, | |
| 34 int zoom_percent, | |
| 35 bool auto_close); | |
| 36 virtual ~ZoomBubbleView(); | |
| 37 | |
| 38 void Close(); | |
| 39 | |
| 40 static ZoomBubbleView* zoom_bubble_; | |
| 41 | |
| 42 base::WeakPtrFactory<ZoomBubbleView> factory_; | |
| 43 | |
| 44 int zoom_percent_; | |
| 45 bool auto_close_; | |
| 46 views::Label* zoom_percent_label_; | |
| 47 }; | |
|
Ben Goodger (Google)
2012/06/22 19:16:06
DISALLOW_COPY_AND_ASSIGN(..
Kyle Horimoto
2012/06/26 21:55:53
Done.
| |
| 48 | |
| 49 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_BUBBLE_VIEW_H_ | |
| OLD | NEW |