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

Unified Diff: ui/views/controls/button/label_button.h

Issue 2801583002: Use views::style for buttons, bootstrap ash_typography to do so. (Closed)
Patch Set: placate gn check. new_avatar_button now just avatar_button 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/button/label_button.h
diff --git a/ui/views/controls/button/label_button.h b/ui/views/controls/button/label_button.h
index 4661d20df5655663b26d4a9e70e723dc1b31522f..8495c436c70e2c327793ce01e5d6964e51126274 100644
--- a/ui/views/controls/button/label_button.h
+++ b/ui/views/controls/button/label_button.h
@@ -17,6 +17,7 @@
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/native_theme_delegate.h"
+#include "ui/views/style/typography.h"
namespace views {
@@ -33,7 +34,12 @@ class VIEWS_EXPORT LabelButton : public CustomButton,
static const char kViewClassName[];
- LabelButton(ButtonListener* listener, const base::string16& text);
+ // Creates a LabelButton with ButtonPressed() events sent to |listener| and
+ // label |text|. |button_context| is a value from views::style::TextContext
+ // and determines the appearance of |text|.
+ LabelButton(ButtonListener* listener,
+ const base::string16& text,
+ int button_context = style::CONTEXT_BUTTON);
~LabelButton() override;
// Gets or sets the image shown for the specified button state.
@@ -57,9 +63,6 @@ class VIEWS_EXPORT LabelButton : public CustomButton,
// Sets whether subpixel rendering is used on the label.
void SetTextSubpixelRenderingEnabled(bool enabled);
- // Adjusts the font size up or down by the given amount.
- virtual void AdjustFontSize(int font_size_delta);
-
// Sets the elide behavior of this button.
void SetElideBehavior(gfx::ElideBehavior elide_behavior);
@@ -121,9 +124,6 @@ class VIEWS_EXPORT LabelButton : public CustomButton,
// these bounds if they need room to do manual painting.
virtual gfx::Rect GetChildAreaBounds();
- // Sets the font list used by this button.
- virtual void SetFontList(const gfx::FontList& font_list);
-
// Returns true if the CreateInkDrop*() methods should create flood fill ink
// drop components.
virtual bool ShouldUseFloodFillInkDrop() const;
@@ -198,9 +198,10 @@ class VIEWS_EXPORT LabelButton : public CustomButton,
// drawing |label_| on a layer (which can mess with subpixel anti-aliasing).
InkDropContainerView* ink_drop_container_;
- // The cached font lists in the normal and bold style.
+ // The cached font lists in the normal and default button style. The latter
+ // may be bold.
gfx::FontList cached_normal_font_list_;
- gfx::FontList cached_bold_font_list_;
+ gfx::FontList cached_default_button_font_list_;
// The images and colors for each button state.
gfx::ImageSkia button_state_images_[STATE_COUNT];

Powered by Google App Engine
This is Rietveld 408576698