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_CHROME_TO_MOBILE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CHROME_TO_MOBILE_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CHROME_TO_MOBILE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CHROME_TO_MOBILE_VIEW_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/command_updater.h" | 9 #include "chrome/browser/command_updater.h" |
10 #include "chrome/browser/ui/views/location_bar/touchable_location_bar_view.h" | 10 #include "chrome/browser/ui/views/location_bar/touchable_location_bar_view.h" |
11 #include "ui/views/controls/image_view.h" | 11 #include "ui/views/controls/image_view.h" |
12 | 12 |
13 class LocationBarView; | 13 class LocationBarView; |
14 | 14 |
15 namespace views { | 15 namespace views { |
16 class KeyEvent; | 16 class KeyEvent; |
17 class MouseEvent; | 17 class MouseEvent; |
18 } | 18 } |
19 | 19 |
20 // A Page Action image view for the Chrome To Mobile bubble. | 20 // A Page Action image view for the Chrome To Mobile bubble. |
21 class ChromeToMobileView : public views::ImageView, | 21 class ChromeToMobileView : public views::ImageView, |
22 public CommandUpdater::CommandObserver, | 22 public CommandObserver, |
23 public TouchableLocationBarView { | 23 public TouchableLocationBarView { |
24 public: | 24 public: |
25 ChromeToMobileView(LocationBarView* location_bar_view, | 25 ChromeToMobileView(LocationBarView* location_bar_view, |
26 CommandUpdater* command_updater); | 26 CommandUpdater* command_updater); |
27 virtual ~ChromeToMobileView(); | 27 virtual ~ChromeToMobileView(); |
28 | 28 |
29 // CommandUpdater::CommandObserver overrides: | 29 // CommandObserver overrides: |
30 virtual void EnabledStateChangedForCommand(int id, bool enabled) OVERRIDE; | 30 virtual void EnabledStateChangedForCommand(int id, bool enabled) OVERRIDE; |
31 | 31 |
32 // TouchableLocationBarView. | 32 // TouchableLocationBarView. |
33 virtual int GetBuiltInHorizontalPadding() const OVERRIDE; | 33 virtual int GetBuiltInHorizontalPadding() const OVERRIDE; |
34 | 34 |
35 private: | 35 private: |
36 // views::ImageView overrides: | 36 // views::ImageView overrides: |
37 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 37 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
38 virtual bool GetTooltipText(const gfx::Point& p, | 38 virtual bool GetTooltipText(const gfx::Point& p, |
39 string16* tooltip) const OVERRIDE; | 39 string16* tooltip) const OVERRIDE; |
40 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; | 40 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; |
41 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; | 41 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; |
42 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; | 42 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; |
43 | 43 |
44 // The LocationBarView hosting this view. | 44 // The LocationBarView hosting this view. |
45 LocationBarView* location_bar_view_; | 45 LocationBarView* location_bar_view_; |
46 | 46 |
47 // The CommandUpdater for the Browser object that owns the location bar. | 47 // The CommandUpdater for the Browser object that owns the location bar. |
48 CommandUpdater* command_updater_; | 48 CommandUpdater* command_updater_; |
49 | 49 |
50 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeToMobileView); | 50 DISALLOW_IMPLICIT_CONSTRUCTORS(ChromeToMobileView); |
51 }; | 51 }; |
52 | 52 |
53 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CHROME_TO_MOBILE_VIEW_H_ | 53 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_CHROME_TO_MOBILE_VIEW_H_ |
OLD | NEW |