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