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 static void ShowBubble(views::View* anchor_view, |
| 18 int zoom_percent, |
| 19 bool autoclose); |
| 20 static void CloseBubble(); |
| 21 static bool IsShowing(); |
| 22 |
| 23 // views::WidgetDelegate method. |
| 24 virtual void WindowClosing() OVERRIDE; |
| 25 |
| 26 protected: |
| 27 // views::BubbleDelegateView method. |
| 28 virtual void Init() OVERRIDE; |
| 29 |
| 30 private: |
| 31 ZoomBubbleView(views::View* anchor_view, |
| 32 int zoom_percent, |
| 33 bool autoclose); |
| 34 virtual ~ZoomBubbleView(); |
| 35 |
| 36 void Close(); |
| 37 |
| 38 static ZoomBubbleView* zoom_bubble_; |
| 39 |
| 40 base::WeakPtrFactory<ZoomBubbleView> factory_; |
| 41 |
| 42 int zoom_percent_; |
| 43 bool autoclose_; |
| 44 views::Label* zoom_percent_label_; |
| 45 }; |
| 46 |
| 47 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_BUBBLE_VIEW_H_ |
OLD | NEW |