| 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_ICON_LABEL_BUBBLE_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
| 11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
| 12 #include "ui/views/view.h" | 12 #include "ui/views/view.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class Canvas; | 15 class Canvas; |
| 16 class Font; | 16 class FontList; |
| 17 class ImageSkia; | 17 class ImageSkia; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace views { | 20 namespace views { |
| 21 class ImageView; | 21 class ImageView; |
| 22 class Label; | 22 class Label; |
| 23 class Painter; | 23 class Painter; |
| 24 } | 24 } |
| 25 | 25 |
| 26 // View used to draw a bubble to the left of the address, containing an icon and | 26 // View used to draw a bubble to the left of the address, containing an icon and |
| 27 // a label. We use this as a base for the classes that handle the EV bubble and | 27 // a label. We use this as a base for the classes that handle the EV bubble and |
| 28 // tab-to-search UI. | 28 // tab-to-search UI. |
| 29 class IconLabelBubbleView : public views::View { | 29 class IconLabelBubbleView : public views::View { |
| 30 public: | 30 public: |
| 31 // The label will be positioned |font_y_offset| px. from the top of the view. | 31 // The label will be positioned |font_y_offset| px. from the top of the view. |
| 32 // |hover_background_images| is an optional set of images to be used in place | 32 // |hover_background_images| is an optional set of images to be used in place |
| 33 // of |background_images| during mouse hover. | 33 // of |background_images| during mouse hover. |
| 34 IconLabelBubbleView(const int background_images[], | 34 IconLabelBubbleView(const int background_images[], |
| 35 const int hover_background_images[], | 35 const int hover_background_images[], |
| 36 int contained_image, | 36 int contained_image, |
| 37 const gfx::Font& font, | 37 const gfx::FontList& font_list, |
| 38 int font_y_offset, | 38 int font_y_offset, |
| 39 SkColor text_color, | 39 SkColor text_color, |
| 40 SkColor parent_background_color, | 40 SkColor parent_background_color, |
| 41 bool elide_in_middle); | 41 bool elide_in_middle); |
| 42 virtual ~IconLabelBubbleView(); | 42 virtual ~IconLabelBubbleView(); |
| 43 | 43 |
| 44 void SetLabel(const string16& label); | 44 void SetLabel(const string16& label); |
| 45 void SetImage(const gfx::ImageSkia& image); | 45 void SetImage(const gfx::ImageSkia& image); |
| 46 void set_is_extension_icon(bool is_extension_icon) { | 46 void set_is_extension_icon(bool is_extension_icon) { |
| 47 is_extension_icon_ = is_extension_icon; | 47 is_extension_icon_ = is_extension_icon; |
| (...skipping 29 matching lines...) Expand all Loading... |
| 77 views::ImageView* image_; | 77 views::ImageView* image_; |
| 78 views::Label* label_; | 78 views::Label* label_; |
| 79 | 79 |
| 80 bool is_extension_icon_; | 80 bool is_extension_icon_; |
| 81 bool in_hover_; | 81 bool in_hover_; |
| 82 | 82 |
| 83 DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView); | 83 DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView); |
| 84 }; | 84 }; |
| 85 | 85 |
| 86 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ | 86 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ |
| OLD | NEW |