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