| 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_LOCATION_ICON_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_ICON_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_ICON_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_ICON_VIEW_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/ui/views/location_bar/page_info_helper.h" | 8 #include "chrome/browser/ui/views/location_bar/page_info_helper.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 LocationBarView; | 12 class LocationBarView; |
| 13 namespace views { | 13 namespace views { |
| 14 class MouseEvent; | 14 class MouseEvent; |
| 15 } | 15 } |
| 16 | 16 |
| 17 // LocationIconView is used to display an icon to the left of the edit field. | 17 // LocationIconView is used to display an icon to the left of the edit field. |
| 18 // This shows the user's current action while editing, the page security | 18 // This shows the user's current action while editing, the page security |
| 19 // status on https pages, or a globe for other URLs. | 19 // status on https pages, or a globe for other URLs. |
| 20 class LocationIconView | 20 class LocationIconView |
| 21 : public views::ImageView, | 21 : public views::ImageView, |
| 22 public TouchableLocationBarView { | 22 public TouchableLocationBarView { |
| 23 public: | 23 public: |
| 24 explicit LocationIconView(LocationBarView* location_bar); | 24 explicit LocationIconView(LocationBarView* location_bar); |
| 25 virtual ~LocationIconView(); | 25 virtual ~LocationIconView(); |
| 26 | 26 |
| 27 // Overridden from views::ImageView: | 27 // Overridden from views::ImageView: |
| 28 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 28 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
| 29 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 29 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
| 30 virtual ui::GestureStatus OnGestureEvent( | 30 virtual ui::EventResult OnGestureEvent( |
| 31 const ui::GestureEvent& event) OVERRIDE; | 31 const ui::GestureEvent& event) OVERRIDE; |
| 32 | 32 |
| 33 // TouchableLocationBarView. | 33 // TouchableLocationBarView. |
| 34 virtual int GetBuiltInHorizontalPadding() const OVERRIDE; | 34 virtual int GetBuiltInHorizontalPadding() const OVERRIDE; |
| 35 | 35 |
| 36 // Whether we should show the tooltip for this icon or not. | 36 // Whether we should show the tooltip for this icon or not. |
| 37 void ShowTooltip(bool show); | 37 void ShowTooltip(bool show); |
| 38 | 38 |
| 39 private: | 39 private: |
| 40 PageInfoHelper page_info_helper_; | 40 PageInfoHelper page_info_helper_; |
| 41 | 41 |
| 42 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationIconView); | 42 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationIconView); |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_ICON_VIEW_H_ | 45 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_ICON_VIEW_H_ |
| OLD | NEW |