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_VIEW_H_ | |
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_ | |
7 #pragma once | |
8 | |
9 #include "base/basictypes.h" | |
10 #include "chrome/browser/ui/zoom/zoom_controller.h" | |
11 #include "ui/views/controls/image_view.h" | |
12 | |
13 namespace views { | |
14 class KeyEvent; | |
15 class MouseEvent; | |
16 } | |
17 | |
18 // View for the zoom icon in the Omnibox. | |
19 class ZoomView : public views::ImageView { | |
20 public: | |
21 ZoomView(); | |
22 virtual ~ZoomView(); | |
23 | |
24 void SetZoomIconState(ZoomController::ZoomIconState zoom_icon_state); | |
25 void SetZoomIconTooltipPercent(int zoom_percent); | |
26 | |
27 void Update(); | |
Peter Kasting
2012/06/22 20:16:20
Nit: Add comments
Kyle Horimoto
2012/06/26 21:55:53
Done.
| |
28 private: | |
Peter Kasting
2012/06/22 20:16:20
Nit: Add blank line above
Kyle Horimoto
2012/06/26 21:55:53
Done.
| |
29 // views::ImageView overrides: | |
30 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | |
31 virtual bool GetTooltipText(const gfx::Point& p, | |
32 string16* tooltip) const OVERRIDE; | |
33 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; | |
34 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; | |
35 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; | |
36 | |
37 // The current icon state. | |
38 ZoomController::ZoomIconState zoom_icon_state_; | |
39 | |
40 // The current zoom percentage. | |
41 int zoom_percent_; | |
42 | |
43 DISALLOW_COPY_AND_ASSIGN(ZoomView); | |
44 }; | |
45 | |
46 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_ | |
OLD | NEW |