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