Chromium Code Reviews| 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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace views { | 23 namespace views { |
| 24 class Label; | 24 class Label; |
| 25 class Painter; | 25 class Painter; |
| 26 } | 26 } |
| 27 | 27 |
| 28 // View used to draw a bubble, containing an icon and a label. We use this as a | 28 // View used to draw a bubble, containing an icon and a label. We use this as a |
| 29 // base for the classes that handle the location icon (including the EV bubble), | 29 // base for the classes that handle the location icon (including the EV bubble), |
| 30 // tab-to-search UI, and content settings. | 30 // tab-to-search UI, and content settings. |
| 31 class IconLabelBubbleView : public views::ImageView { | 31 class IconLabelBubbleView : public views::View { |
| 32 public: | 32 public: |
| 33 IconLabelBubbleView(int contained_image, | 33 IconLabelBubbleView(int contained_image, |
| 34 const gfx::FontList& font_list, | 34 const gfx::FontList& font_list, |
| 35 SkColor parent_background_color, | 35 SkColor parent_background_color, |
| 36 bool elide_in_middle); | 36 bool elide_in_middle); |
| 37 ~IconLabelBubbleView() override; | 37 ~IconLabelBubbleView() override; |
| 38 | 38 |
| 39 // Sets a background that paints |background_images| in a scalable grid. | 39 // Sets a background that paints |background_images| in a scalable grid. |
| 40 // Subclasses must call this during construction. | 40 // Subclasses must call this during construction. |
| 41 void SetBackgroundImageGrid(const int background_images[]); | 41 void SetBackgroundImageGrid(const int background_images[]); |
| 42 void UnsetBackgroundImageGrid(); | 42 void UnsetBackgroundImageGrid(); |
| 43 | 43 |
| 44 void SetLabel(const base::string16& label); | 44 void SetLabel(const base::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; |
| 48 } | 48 } |
| 49 | 49 |
| 50 const views::ImageView* GetImageView() const { return image_; } | |
|
Evan Stade
2016/01/22 23:58:37
I didn't want to publicly expose a non-const point
| |
| 51 | |
| 50 protected: | 52 protected: |
| 51 views::ImageView* image() { return image_; } | 53 views::ImageView* image() { return image_; } |
| 52 views::Label* label() { return label_; } | 54 views::Label* label() { return label_; } |
| 53 | 55 |
| 54 // Gets the color for displaying text. | 56 // Gets the color for displaying text. |
| 55 virtual SkColor GetTextColor() const = 0; | 57 virtual SkColor GetTextColor() const = 0; |
| 56 | 58 |
| 57 // Gets the color for the border (a more transparent version of which is used | 59 // Gets the color for the border (a more transparent version of which is used |
| 58 // for the background). | 60 // for the background). |
| 59 virtual SkColor GetBorderColor() const = 0; | 61 virtual SkColor GetBorderColor() const = 0; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 111 // the native theme (so it responds to native theme updates). TODO(estade): | 113 // the native theme (so it responds to native theme updates). TODO(estade): |
| 112 // remove when MD is default. | 114 // remove when MD is default. |
| 113 SkColor parent_background_color_; | 115 SkColor parent_background_color_; |
| 114 | 116 |
| 115 bool should_show_background_; | 117 bool should_show_background_; |
| 116 | 118 |
| 117 DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView); | 119 DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView); |
| 118 }; | 120 }; |
| 119 | 121 |
| 120 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ | 122 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ |
| OLD | NEW |