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

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

Issue 2556833002: Make LabelButton::SetFontList protected. (Closed)
Patch Set: update test Created 4 years 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 <memory> 8 #include <memory>
9 9
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 // Sets the text colors shown for the non-disabled states to |color|. 50 // Sets the text colors shown for the non-disabled states to |color|.
51 virtual void SetEnabledTextColors(SkColor color); 51 virtual void SetEnabledTextColors(SkColor color);
52 52
53 // Sets drop shadows underneath the text. 53 // Sets drop shadows underneath the text.
54 void SetTextShadows(const gfx::ShadowValues& shadows); 54 void SetTextShadows(const gfx::ShadowValues& shadows);
55 55
56 // Sets whether subpixel rendering is used on the label. 56 // Sets whether subpixel rendering is used on the label.
57 void SetTextSubpixelRenderingEnabled(bool enabled); 57 void SetTextSubpixelRenderingEnabled(bool enabled);
58 58
59 // Gets or sets the font list used by this button. 59 // TODO(estade): remove. See crbug.com/633986
60 const gfx::FontList& GetFontList() const; 60 void SetFontListDeprecated(const gfx::FontList& font_list);
61 // TODO(estade): make this function protected.
62 virtual void SetFontList(const gfx::FontList& font_list);
63 61
64 // Adjusts the font size up or down by the given amount. 62 // Adjusts the font size up or down by the given amount.
65 virtual void AdjustFontSize(int font_size_delta); 63 virtual void AdjustFontSize(int font_size_delta);
66 64
67 // Sets the elide behavior of this button. 65 // Sets the elide behavior of this button.
68 void SetElideBehavior(gfx::ElideBehavior elide_behavior); 66 void SetElideBehavior(gfx::ElideBehavior elide_behavior);
69 67
70 // Sets the horizontal alignment used for the button; reversed in RTL. The 68 // Sets the horizontal alignment used for the button; reversed in RTL. The
71 // optional image will lead the text, unless the button is right-aligned. 69 // optional image will lead the text, unless the button is right-aligned.
72 void SetHorizontalAlignment(gfx::HorizontalAlignment alignment); 70 void SetHorizontalAlignment(gfx::HorizontalAlignment alignment);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 Label* label() const { return label_; } 111 Label* label() const { return label_; }
114 112
115 bool explicitly_set_normal_color() const { 113 bool explicitly_set_normal_color() const {
116 return explicitly_set_colors_[STATE_NORMAL]; 114 return explicitly_set_colors_[STATE_NORMAL];
117 } 115 }
118 116
119 // Returns the available area for the label and image. Subclasses can change 117 // Returns the available area for the label and image. Subclasses can change
120 // these bounds if they need room to do manual painting. 118 // these bounds if they need room to do manual painting.
121 virtual gfx::Rect GetChildAreaBounds(); 119 virtual gfx::Rect GetChildAreaBounds();
122 120
121 // Sets the font list used by this button.
122 virtual void SetFontList(const gfx::FontList& font_list);
123
123 // View: 124 // View:
124 void OnPaint(gfx::Canvas* canvas) override; 125 void OnPaint(gfx::Canvas* canvas) override;
125 void OnFocus() override; 126 void OnFocus() override;
126 void OnBlur() override; 127 void OnBlur() override;
127 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; 128 void OnNativeThemeChanged(const ui::NativeTheme* theme) override;
128 129
129 // CustomButton: 130 // CustomButton:
130 void StateChanged() override; 131 void StateChanged() override;
131 132
132 // Fills |params| with information about the button. 133 // Fills |params| with information about the button.
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 gfx::HorizontalAlignment horizontal_alignment_; 236 gfx::HorizontalAlignment horizontal_alignment_;
236 237
237 std::unique_ptr<Painter> focus_painter_; 238 std::unique_ptr<Painter> focus_painter_;
238 239
239 DISALLOW_COPY_AND_ASSIGN(LabelButton); 240 DISALLOW_COPY_AND_ASSIGN(LabelButton);
240 }; 241 };
241 242
242 } // namespace views 243 } // namespace views
243 244
244 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_ 245 #endif // UI_VIEWS_CONTROLS_BUTTON_LABEL_BUTTON_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/profiles/profile_chooser_view.cc ('k') | ui/views/controls/button/label_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698