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 11 matching lines...) Expand all Loading... | |
| 22 | 22 |
| 23 namespace views { | 23 namespace views { |
| 24 class ImageView; | 24 class ImageView; |
| 25 class Label; | 25 class Label; |
| 26 class Painter; | 26 class Painter; |
| 27 } | 27 } |
| 28 | 28 |
| 29 // View used to draw a bubble, containing an icon and a label. We use this as a | 29 // View used to draw a bubble, containing an icon and a label. We use this as a |
| 30 // base for the classes that handle the location icon (including the EV bubble), | 30 // base for the classes that handle the location icon (including the EV bubble), |
| 31 // tab-to-search UI, and content settings. | 31 // tab-to-search UI, and content settings. |
| 32 class IconLabelBubbleView : public views::InkDropHostView { | 32 class IconLabelBubbleView : public views::InkDropHostView { |
|
Evan Stade
2016/05/19 21:20:45
Bubble is no longer the best terminology, but I'll
Evan Stade
2016/05/19 21:24:49
this was supposed to be "...is the only D"
| |
| 33 public: | 33 public: |
| 34 IconLabelBubbleView(int contained_image, | 34 IconLabelBubbleView(int contained_image, |
| 35 const gfx::FontList& font_list, | 35 const gfx::FontList& font_list, |
| 36 SkColor parent_background_color, | 36 SkColor parent_background_color, |
| 37 bool elide_in_middle); | 37 bool elide_in_middle); |
| 38 ~IconLabelBubbleView() override; | 38 ~IconLabelBubbleView() override; |
| 39 | 39 |
| 40 // Sets a background that paints |background_images| in a scalable grid. | 40 // Sets a background that paints |background_images| in a scalable grid. |
| 41 // Subclasses must call this during construction. | 41 // Subclasses must call this during construction. |
| 42 void SetBackgroundImageGrid(const int background_images[]); | 42 void SetBackgroundImageGrid(const int background_images[]); |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 116 const char* GetClassName() const override; | 116 const char* GetClassName() const override; |
| 117 void OnPaint(gfx::Canvas* canvas) override; | 117 void OnPaint(gfx::Canvas* canvas) override; |
| 118 | 118 |
| 119 // For painting the background. TODO(estade): remove post MD launch. | 119 // For painting the background. TODO(estade): remove post MD launch. |
| 120 std::unique_ptr<views::Painter> background_painter_; | 120 std::unique_ptr<views::Painter> background_painter_; |
| 121 | 121 |
| 122 // The contents of the bubble. | 122 // The contents of the bubble. |
| 123 views::ImageView* image_; | 123 views::ImageView* image_; |
| 124 views::Label* label_; | 124 views::Label* label_; |
| 125 | 125 |
| 126 // How much horizontal padding (fully-transparent columns) is inside the | |
| 127 // image. These are subtracted from the desired padding values when | |
| 128 // calculating the padding around the image, so that the image always appears | |
| 129 // to have the same visible padding no matter what its composition is. Only | |
| 130 // used in MD. | |
| 131 int builtin_leading_padding_; | |
| 132 int builtin_trailing_padding_; | |
|
Evan Stade
2016/05/19 21:20:45
I believe this is no longer necessary given that t
| |
| 133 | |
| 134 bool is_extension_icon_; | 126 bool is_extension_icon_; |
| 135 | 127 |
| 136 // This is only used in pre-MD. In MD, the background color is derived from | 128 // This is only used in pre-MD. In MD, the background color is derived from |
| 137 // the native theme (so it responds to native theme updates). TODO(estade): | 129 // the native theme (so it responds to native theme updates). TODO(estade): |
| 138 // remove when MD is default. | 130 // remove when MD is default. |
| 139 SkColor parent_background_color_; | 131 SkColor parent_background_color_; |
| 140 | 132 |
| 141 bool should_show_background_; | 133 bool should_show_background_; |
| 142 | 134 |
| 143 DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView); | 135 DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView); |
| 144 }; | 136 }; |
| 145 | 137 |
| 146 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ | 138 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ |
| OLD | NEW |