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