Chromium Code Reviews| 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 "chrome/browser/ui/zoom/zoom_controller.h" | |
| 10 #include "ui/views/controls/image_view.h" | |
| 11 | |
| 12 namespace views { | |
| 13 class KeyEvent; | |
| 14 class MouseEvent; | |
| 15 } | |
| 16 | |
| 17 // View for the zoom icon in the Omnibox. | |
| 18 class ZoomView : public views::ImageView { | |
| 19 public: | |
| 20 explicit ZoomView(); | |
|
Ben Goodger (Google)
2012/06/04 15:16:49
-explicit
Kyle Horimoto
2012/06/05 05:03:59
Done.
| |
| 21 virtual ~ZoomView(); | |
| 22 | |
| 23 void SetZoomIconState(ZoomController::ZoomIconState zoom_icon_state); | |
| 24 void SetZoomIconTooltipPercent(int zoom_percent); | |
| 25 | |
| 26 private: | |
| 27 void Update(); | |
| 28 | |
| 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 }; | |
|
Ben Goodger (Google)
2012/06/04 15:16:49
DISALLOW_COPY_AND
Kyle Horimoto
2012/06/05 05:03:59
Done.
| |
| 43 | |
| 44 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ZOOM_VIEW_H_ | |
| OLD | NEW |