Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(812)

Side by Side Diff: ui/views/controls/button/label_button.h

Issue 2851543002: Update avatar button to MD (part 1) (Closed)
Patch Set: More review changes Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 // NativeThemeDelegate: 151 // NativeThemeDelegate:
152 gfx::Rect GetThemePaintRect() const override; 152 gfx::Rect GetThemePaintRect() const override;
153 153
154 const std::array<bool, STATE_COUNT>& explicitly_set_colors() const { 154 const std::array<bool, STATE_COUNT>& explicitly_set_colors() const {
155 return explicitly_set_colors_; 155 return explicitly_set_colors_;
156 } 156 }
157 void set_explicitly_set_colors(const std::array<bool, STATE_COUNT>& colors) { 157 void set_explicitly_set_colors(const std::array<bool, STATE_COUNT>& colors) {
158 explicitly_set_colors_ = colors; 158 explicitly_set_colors_ = colors;
159 } 159 }
160 160
161 // Returns true if the CreateInkDrop*() methods should create flood fill ink
162 // drop components.
163 virtual bool UseFloodFillInkDrop() const;
Evan Stade 2017/05/02 15:49:20 nit: rearrange ordering in .cc file to match new o
emx 2017/05/03 17:10:59 Done.
164
161 private: 165 private:
162 void SetTextInternal(const base::string16& text); 166 void SetTextInternal(const base::string16& text);
163 167
164 // View: 168 // View:
165 void ChildPreferredSizeChanged(View* child) override; 169 void ChildPreferredSizeChanged(View* child) override;
166 170
167 // NativeThemeDelegate: 171 // NativeThemeDelegate:
168 ui::NativeTheme::Part GetThemePart() const override; 172 ui::NativeTheme::Part GetThemePart() const override;
169 ui::NativeTheme::State GetThemeState( 173 ui::NativeTheme::State GetThemeState(
170 ui::NativeTheme::ExtraParams* params) const override; 174 ui::NativeTheme::ExtraParams* params) const override;
171 const gfx::Animation* GetThemeAnimation() const override; 175 const gfx::Animation* GetThemeAnimation() const override;
172 ui::NativeTheme::State GetBackgroundThemeState( 176 ui::NativeTheme::State GetBackgroundThemeState(
173 ui::NativeTheme::ExtraParams* params) const override; 177 ui::NativeTheme::ExtraParams* params) const override;
174 ui::NativeTheme::State GetForegroundThemeState( 178 ui::NativeTheme::State GetForegroundThemeState(
175 ui::NativeTheme::ExtraParams* params) const override; 179 ui::NativeTheme::ExtraParams* params) const override;
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698