OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/ui/views/location_bar/bubble_icon_view.h" | 9 #include "chrome/browser/ui/views/location_bar/bubble_icon_view.h" |
10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
11 | 11 |
12 namespace ui_zoom { | 12 namespace zoom { |
13 class ZoomController; | 13 class ZoomController; |
14 } | 14 } |
15 | 15 |
16 // View for the zoom icon in the Omnibox. | 16 // View for the zoom icon in the Omnibox. |
17 class ZoomView : public BubbleIconView { | 17 class ZoomView : public BubbleIconView { |
18 public: | 18 public: |
19 // Clicking on the ZoomView shows a ZoomBubbleView, which requires the current | 19 // Clicking on the ZoomView shows a ZoomBubbleView, which requires the current |
20 // WebContents. Because the current WebContents changes as the user switches | 20 // WebContents. Because the current WebContents changes as the user switches |
21 // tabs, a LocationBarView::Delegate is supplied to queried for the current | 21 // tabs, a LocationBarView::Delegate is supplied to queried for the current |
22 // WebContents when needed. | 22 // WebContents when needed. |
23 explicit ZoomView(LocationBarView::Delegate* location_bar_delegate); | 23 explicit ZoomView(LocationBarView::Delegate* location_bar_delegate); |
24 ~ZoomView() override; | 24 ~ZoomView() override; |
25 | 25 |
26 // Updates the image and its tooltip appropriately, hiding or showing the icon | 26 // Updates the image and its tooltip appropriately, hiding or showing the icon |
27 // as needed. | 27 // as needed. |
28 void Update(ui_zoom::ZoomController* zoom_controller); | 28 void Update(zoom::ZoomController* zoom_controller); |
29 | 29 |
30 protected: | 30 protected: |
31 // BubbleIconView: | 31 // BubbleIconView: |
32 void OnExecuting(BubbleIconView::ExecuteSource source) override; | 32 void OnExecuting(BubbleIconView::ExecuteSource source) override; |
33 void GetAccessibleState(ui::AXViewState* state) override; | 33 void GetAccessibleState(ui::AXViewState* state) override; |
34 views::BubbleDialogDelegateView* GetBubble() const override; | 34 views::BubbleDialogDelegateView* GetBubble() const override; |
35 gfx::VectorIconId GetVectorIcon() const override; | 35 gfx::VectorIconId GetVectorIcon() const override; |
36 | 36 |
37 private: | 37 private: |
38 // The delegate used to get the currently visible WebContents. | 38 // The delegate used to get the currently visible WebContents. |
39 LocationBarView::Delegate* location_bar_delegate_; | 39 LocationBarView::Delegate* location_bar_delegate_; |
40 | 40 |
41 gfx::VectorIconId image_id_; | 41 gfx::VectorIconId image_id_; |
42 | 42 |
43 DISALLOW_COPY_AND_ASSIGN(ZoomView); | 43 DISALLOW_COPY_AND_ASSIGN(ZoomView); |
44 }; | 44 }; |
45 | 45 |
46 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_ | 46 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_ |
OLD | NEW |