| 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_METRO_PIN_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_METRO_PIN_VIEW_H_ |
| 7 |
| 8 #include "chrome/browser/ui/views/location_bar/touchable_location_bar_view.h" |
| 9 #include "ui/views/controls/image_view.h" |
| 10 |
| 11 class CommandUpdater; |
| 12 |
| 13 namespace views { |
| 14 class KeyEvent; |
| 15 class MouseEvent; |
| 16 } |
| 17 |
| 18 class MetroPinView |
| 19 : public views::ImageView, |
| 20 public TouchableLocationBarView { |
| 21 public: |
| 22 explicit MetroPinView(CommandUpdater* command_updater); |
| 23 virtual ~MetroPinView(); |
| 24 |
| 25 // When the page is already pinned, clicking the pin view will cause the page |
| 26 // to become unpinned. |
| 27 void SetIsPinned(bool is_pinned); |
| 28 |
| 29 // TouchableLocationBarView. |
| 30 virtual int GetBuiltInHorizontalPadding() const OVERRIDE; |
| 31 |
| 32 private: |
| 33 // views::ImageView overrides: |
| 34 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
| 35 virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE; |
| 36 virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE; |
| 37 virtual ui::GestureStatus OnGestureEvent( |
| 38 const views::GestureEvent& event) OVERRIDE; |
| 39 virtual bool OnKeyPressed(const views::KeyEvent& event) OVERRIDE; |
| 40 |
| 41 // The CommandUpdater for the Browser object that owns the location bar. |
| 42 CommandUpdater* command_updater_; |
| 43 |
| 44 DISALLOW_IMPLICIT_CONSTRUCTORS(MetroPinView); |
| 45 }; |
| 46 |
| 47 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_METRO_PIN_VIEW_H_ |
| OLD | NEW |