| 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 class ZoomController; | 13 class ZoomController; |
| 14 } |
| 13 | 15 |
| 14 // View for the zoom icon in the Omnibox. | 16 // View for the zoom icon in the Omnibox. |
| 15 class ZoomView : public BubbleIconView { | 17 class ZoomView : public BubbleIconView { |
| 16 public: | 18 public: |
| 17 // Clicking on the ZoomView shows a ZoomBubbleView, which requires the current | 19 // Clicking on the ZoomView shows a ZoomBubbleView, which requires the current |
| 18 // WebContents. Because the current WebContents changes as the user switches | 20 // WebContents. Because the current WebContents changes as the user switches |
| 19 // tabs, a LocationBarView::Delegate is supplied to queried for the current | 21 // tabs, a LocationBarView::Delegate is supplied to queried for the current |
| 20 // WebContents when needed. | 22 // WebContents when needed. |
| 21 explicit ZoomView(LocationBarView::Delegate* location_bar_delegate); | 23 explicit ZoomView(LocationBarView::Delegate* location_bar_delegate); |
| 22 ~ZoomView() override; | 24 ~ZoomView() override; |
| 23 | 25 |
| 24 // 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 |
| 25 // as needed. | 27 // as needed. |
| 26 void Update(ZoomController* zoom_controller); | 28 void Update(ui_zoom::ZoomController* zoom_controller); |
| 27 | 29 |
| 28 protected: | 30 protected: |
| 29 // BubbleIconView: | 31 // BubbleIconView: |
| 30 bool IsBubbleShowing() const override; | 32 bool IsBubbleShowing() const override; |
| 31 void OnExecuting(BubbleIconView::ExecuteSource source) override; | 33 void OnExecuting(BubbleIconView::ExecuteSource source) override; |
| 32 void GetAccessibleState(ui::AXViewState* state) override; | 34 void GetAccessibleState(ui::AXViewState* state) override; |
| 33 | 35 |
| 34 private: | 36 private: |
| 35 // The delegate used to get the currently visible WebContents. | 37 // The delegate used to get the currently visible WebContents. |
| 36 LocationBarView::Delegate* location_bar_delegate_; | 38 LocationBarView::Delegate* location_bar_delegate_; |
| 37 | 39 |
| 38 DISALLOW_COPY_AND_ASSIGN(ZoomView); | 40 DISALLOW_COPY_AND_ASSIGN(ZoomView); |
| 39 }; | 41 }; |
| 40 | 42 |
| 41 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_ | 43 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_ |
| OLD | NEW |