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