| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/click_handler.h" | 9 #include "chrome/browser/ui/views/location_bar/click_handler.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<LocationIconView> { |
| 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 | 31 |
| 29 // Whether we should show the tooltip for this icon or not. | 32 // Whether we should show the tooltip for this icon or not. |
| 30 void ShowTooltip(bool show); | 33 void ShowTooltip(bool show); |
| 31 | 34 |
| 32 private: | 35 private: |
| 33 ClickHandler click_handler_; | 36 ClickHandler click_handler_; |
| 34 | 37 |
| 35 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationIconView); | 38 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationIconView); |
| 36 }; | 39 }; |
| 37 | 40 |
| 38 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_ICON_VIEW_H_ | 41 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_ICON_VIEW_H_ |
| OLD | NEW |