| 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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // Returns the amount of horizontal space needed to draw the image and its | 77 // Returns the amount of horizontal space needed to draw the image and its |
| 78 // padding before the label. | 78 // padding before the label. |
| 79 virtual int GetImageAndPaddingWidth() const; | 79 virtual int GetImageAndPaddingWidth() const; |
| 80 | 80 |
| 81 // views::View: | 81 // views::View: |
| 82 gfx::Size GetPreferredSize() const override; | 82 gfx::Size GetPreferredSize() const override; |
| 83 void Layout() override; | 83 void Layout() override; |
| 84 void OnNativeThemeChanged(const ui::NativeTheme* native_theme) override; | 84 void OnNativeThemeChanged(const ui::NativeTheme* native_theme) override; |
| 85 void AddInkDropLayer(ui::Layer* ink_drop_layer) override; | 85 void AddInkDropLayer(ui::Layer* ink_drop_layer) override; |
| 86 void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override; | 86 void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override; |
| 87 scoped_ptr<views::InkDropHover> CreateInkDropHover() const override; | 87 std::unique_ptr<views::InkDropHover> CreateInkDropHover() const override; |
| 88 SkColor GetInkDropBaseColor() const override; | 88 SkColor GetInkDropBaseColor() const override; |
| 89 | 89 |
| 90 const gfx::FontList& font_list() const { return label_->font_list(); } | 90 const gfx::FontList& font_list() const { return label_->font_list(); } |
| 91 | 91 |
| 92 SkColor GetParentBackgroundColor() const; | 92 SkColor GetParentBackgroundColor() const; |
| 93 | 93 |
| 94 gfx::Size GetSizeForLabelWidth(int label_width) const; | 94 gfx::Size GetSizeForLabelWidth(int label_width) const; |
| 95 | 95 |
| 96 // Returns the minimum width the view can be to show the complete image when | 96 // Returns the minimum width the view can be to show the complete image when |
| 97 // the background is showing. | 97 // the background is showing. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 108 int GetOuterPadding(bool leading) const; | 108 int GetOuterPadding(bool leading) const; |
| 109 | 109 |
| 110 // Spacing between the image and the label. | 110 // Spacing between the image and the label. |
| 111 int GetInternalSpacing() const; | 111 int GetInternalSpacing() const; |
| 112 | 112 |
| 113 // views::View: | 113 // views::View: |
| 114 const char* GetClassName() const override; | 114 const char* GetClassName() const override; |
| 115 void OnPaint(gfx::Canvas* canvas) override; | 115 void OnPaint(gfx::Canvas* canvas) override; |
| 116 | 116 |
| 117 // For painting the background. TODO(estade): remove post MD launch. | 117 // For painting the background. TODO(estade): remove post MD launch. |
| 118 scoped_ptr<views::Painter> background_painter_; | 118 std::unique_ptr<views::Painter> background_painter_; |
| 119 | 119 |
| 120 // The contents of the bubble. | 120 // The contents of the bubble. |
| 121 views::ImageView* image_; | 121 views::ImageView* image_; |
| 122 views::Label* label_; | 122 views::Label* label_; |
| 123 | 123 |
| 124 bool is_extension_icon_; | 124 bool is_extension_icon_; |
| 125 | 125 |
| 126 // This is only used in pre-MD. In MD, the background color is derived from | 126 // This is only used in pre-MD. In MD, the background color is derived from |
| 127 // the native theme (so it responds to native theme updates). TODO(estade): | 127 // the native theme (so it responds to native theme updates). TODO(estade): |
| 128 // remove when MD is default. | 128 // remove when MD is default. |
| 129 SkColor parent_background_color_; | 129 SkColor parent_background_color_; |
| 130 | 130 |
| 131 bool should_show_background_; | 131 bool should_show_background_; |
| 132 | 132 |
| 133 DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView); | 133 DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView); |
| 134 }; | 134 }; |
| 135 | 135 |
| 136 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ | 136 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ |
| OLD | NEW |