Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / ui / views / location_bar / zoom_view.h
blob1224f8cbef2e079c3bb1db7ba12ac0c74d9d9a43
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.
5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_
8 #include "base/macros.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"
12 namespace ui_zoom {
13 class ZoomController;
16 // View for the zoom icon in the Omnibox.
17 class ZoomView : public BubbleIconView {
18 public:
19 // Clicking on the ZoomView shows a ZoomBubbleView, which requires the current
20 // WebContents. Because the current WebContents changes as the user switches
21 // tabs, a LocationBarView::Delegate is supplied to queried for the current
22 // WebContents when needed.
23 explicit ZoomView(LocationBarView::Delegate* location_bar_delegate);
24 ~ZoomView() override;
26 // Updates the image and its tooltip appropriately, hiding or showing the icon
27 // as needed.
28 void Update(ui_zoom::ZoomController* zoom_controller);
30 protected:
31 // BubbleIconView:
32 void OnExecuting(BubbleIconView::ExecuteSource source) override;
33 void GetAccessibleState(ui::AXViewState* state) override;
34 views::BubbleDelegateView* GetBubble() const override;
36 private:
37 // The delegate used to get the currently visible WebContents.
38 LocationBarView::Delegate* location_bar_delegate_;
40 DISALLOW_COPY_AND_ASSIGN(ZoomView);
43 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_