| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 93   int GetOuterPadding() const; | 97   int GetOuterPadding() const; | 
| 94 | 98 | 
| 95   // Spacing between the image and the label. | 99   // Spacing between the image and the label. | 
| 96   int GetInternalSpacing() const; | 100   int GetInternalSpacing() const; | 
| 97 | 101 | 
| 98   // Padding after the separator. | 102   // Padding after the separator. | 
| 99   int GetPostSeparatorPadding() const; | 103   int GetPostSeparatorPadding() const; | 
| 100 | 104 | 
| 101   float GetScaleFactor() const; | 105   float GetScaleFactor() const; | 
| 102 | 106 | 
|  | 107   // Returns the size to give to |image_|. | 
|  | 108   gfx::Size GetImageViewSize() const; | 
|  | 109 | 
| 103   // views::View: | 110   // views::View: | 
| 104   const char* GetClassName() const override; | 111   const char* GetClassName() const override; | 
| 105   void OnPaint(gfx::Canvas* canvas) override; | 112   void OnPaint(gfx::Canvas* canvas) override; | 
| 106 | 113 | 
| 107   // The contents of the bubble. | 114   // The contents of the bubble. | 
| 108   views::ImageView* image_; | 115   views::ImageView* image_; | 
| 109   views::Label* label_; | 116   views::Label* label_; | 
| 110 | 117 | 
|  | 118   // The padding of the element that will be displayed after |this|. This value | 
|  | 119   // is relevant for calculating the amount of space to reserve after the | 
|  | 120   // separator. | 
|  | 121   int next_element_interior_padding_ = 0; | 
|  | 122 | 
| 111   DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView); | 123   DISALLOW_COPY_AND_ASSIGN(IconLabelBubbleView); | 
| 112 }; | 124 }; | 
| 113 | 125 | 
| 114 #endif  // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ | 126 #endif  // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ICON_LABEL_BUBBLE_VIEW_H_ | 
| OLD | NEW | 
|---|