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 UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ | 5 #ifndef UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
| 6 #define UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ | 6 #define UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
| 7 | 7 |
| 8 #include <array> | 8 #include <array> |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 144 // Updates the image view to contain the appropriate button state image. | 144 // Updates the image view to contain the appropriate button state image. |
| 145 void UpdateImage(); | 145 void UpdateImage(); |
| 146 | 146 |
| 147 // Updates the border as per the NativeTheme, unless a different border was | 147 // Updates the border as per the NativeTheme, unless a different border was |
| 148 // set with SetBorder. | 148 // set with SetBorder. |
| 149 void UpdateThemedBorder(); | 149 void UpdateThemedBorder(); |
| 150 | 150 |
| 151 // NativeThemeDelegate: | 151 // NativeThemeDelegate: |
| 152 gfx::Rect GetThemePaintRect() const override; | 152 gfx::Rect GetThemePaintRect() const override; |
| 153 | 153 |
| 154 // Returns true if the CreateInkDrop*() methods should create flood fill ink | |
| 155 // drop components. | |
| 156 virtual bool ShouldUseFloodFillInkDrop() const; | |
|
Peter Kasting
2017/05/06 02:23:09
Nit: Prefer to group virtual functions together, a
emx
2017/05/09 16:26:53
Done.
| |
| 157 | |
| 154 const std::array<bool, STATE_COUNT>& explicitly_set_colors() const { | 158 const std::array<bool, STATE_COUNT>& explicitly_set_colors() const { |
| 155 return explicitly_set_colors_; | 159 return explicitly_set_colors_; |
| 156 } | 160 } |
| 157 void set_explicitly_set_colors(const std::array<bool, STATE_COUNT>& colors) { | 161 void set_explicitly_set_colors(const std::array<bool, STATE_COUNT>& colors) { |
| 158 explicitly_set_colors_ = colors; | 162 explicitly_set_colors_ = colors; |
| 159 } | 163 } |
| 160 | 164 |
| 161 private: | 165 private: |
| 162 void SetTextInternal(const base::string16& text); | 166 void SetTextInternal(const base::string16& text); |
| 163 | 167 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 176 | 180 |
| 177 // Resets |cached_preferred_size_| and marks |cached_preferred_size_valid_| | 181 // Resets |cached_preferred_size_| and marks |cached_preferred_size_valid_| |
| 178 // as false. | 182 // as false. |
| 179 void ResetCachedPreferredSize(); | 183 void ResetCachedPreferredSize(); |
| 180 | 184 |
| 181 // Updates additional state related to focus or default status, rather than | 185 // Updates additional state related to focus or default status, rather than |
| 182 // merely the CustomButton::state(). E.g. ensures the label text color is | 186 // merely the CustomButton::state(). E.g. ensures the label text color is |
| 183 // correct for the current background. | 187 // correct for the current background. |
| 184 void ResetLabelEnabledColor(); | 188 void ResetLabelEnabledColor(); |
| 185 | 189 |
| 186 // Returns true if the CreateInkDrop*() methods should create flood fill ink | |
| 187 // drop components. | |
| 188 bool UseFloodFillInkDrop() const; | |
| 189 | |
| 190 // The image and label shown in the button. | 190 // The image and label shown in the button. |
| 191 ImageView* image_; | 191 ImageView* image_; |
| 192 Label* label_; | 192 Label* label_; |
| 193 | 193 |
| 194 // A separate view is necessary to hold the ink drop layer so that it can | 194 // A separate view is necessary to hold the ink drop layer so that it can |
| 195 // be stacked below |image_| and on top of |label_|, without resorting to | 195 // be stacked below |image_| and on top of |label_|, without resorting to |
| 196 // drawing |label_| on a layer (which can mess with subpixel anti-aliasing). | 196 // drawing |label_| on a layer (which can mess with subpixel anti-aliasing). |
| 197 InkDropContainerView* ink_drop_container_; | 197 InkDropContainerView* ink_drop_container_; |
| 198 | 198 |
| 199 // The cached font lists in the normal and bold style. | 199 // The cached font lists in the normal and bold style. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 gfx::HorizontalAlignment horizontal_alignment_; | 237 gfx::HorizontalAlignment horizontal_alignment_; |
| 238 | 238 |
| 239 std::unique_ptr<Painter> focus_painter_; | 239 std::unique_ptr<Painter> focus_painter_; |
| 240 | 240 |
| 241 DISALLOW_COPY_AND_ASSIGN(LabelButton); | 241 DISALLOW_COPY_AND_ASSIGN(LabelButton); |
| 242 }; | 242 }; |
| 243 | 243 |
| 244 } // namespace views | 244 } // namespace views |
| 245 | 245 |
| 246 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ | 246 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ |
| OLD | NEW |