| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 views::ImageView* GetImageView() { return image_; } | 42 views::ImageView* GetImageView() { return image_; } |
| 43 | 43 |
| 44 protected: | 44 protected: |
| 45 static constexpr int kOpenTimeMS = 150; | 45 static constexpr int kOpenTimeMS = 150; |
| 46 | 46 |
| 47 views::ImageView* image() { return image_; } | 47 views::ImageView* image() { return image_; } |
| 48 const views::ImageView* image() const { return image_; } | 48 const views::ImageView* image() const { return image_; } |
| 49 views::Label* label() { return label_; } | 49 views::Label* label() { return label_; } |
| 50 const views::Label* label() const { return label_; } | 50 const views::Label* label() const { return label_; } |
| 51 | 51 |
| 52 void set_next_element_interior_padding(int padding) { |
| 53 next_element_interior_padding_ = padding; |
| 54 } |
| 55 |
| 52 // Gets the color for displaying text. | 56 // Gets the color for displaying text. |
| 53 virtual SkColor GetTextColor() const = 0; | 57 virtual SkColor GetTextColor() const = 0; |
| 54 | 58 |
| 55 // Returns true when the label should be visible. | 59 // Returns true when the label should be visible. |
| 56 virtual bool ShouldShowLabel() const; | 60 virtual bool ShouldShowLabel() const; |
| 57 | 61 |
| 58 // Returns a multiplier used to calculate the actual width of the view based | 62 // Returns a multiplier used to calculate the actual width of the view based |
| 59 // on its desired width. This ranges from 0 for a zero-width view to 1 for a | 63 // on its desired width. This ranges from 0 for a zero-width view to 1 for a |
| 60 // full-width view and can be used to animate the width of the view. | 64 // full-width view and can be used to animate the width of the view. |
| 61 virtual double WidthMultiplier() const; | 65 virtual double WidthMultiplier() const; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 float GetScaleFactor() const; | 105 float GetScaleFactor() const; |
| 102 | 106 |
| 103 // views::View: | 107 // views::View: |
| 104 const char* GetClassName() const override; | 108 const char* GetClassName() const override; |
| 105 void OnPaint(gfx::Canvas* canvas) override; | 109 void OnPaint(gfx::Canvas* canvas) override; |
| 106 | 110 |
| 107 // The contents of the bubble. | 111 // The contents of the bubble. |
| 108 views::ImageView* image_; | 112 views::ImageView* image_; |
| 109 views::Label* label_; | 113 views::Label* label_; |
| 110 | 114 |
| 115 // The padding of the element that will be displayed after |this|. This value |
| 116 // is relevant for calculating the amount of space to reserve after the |
| 117 // separator. |
| 118 int next_element_interior_padding_ = 0; |
| 119 |
| 111 DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView); | 120 DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView); |
| 112 }; | 121 }; |
| 113 | 122 |
| 114 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ | 123 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ |
| OLD | NEW |