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

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

Issue 2851543002: Update avatar button to MD (part 1) (Closed)
Patch Set: Merged ThemedAvatarButton and Win10NativeAvatarButton into the base AvatarButton class 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.cc
diff --git a/ui/views/controls/button/label_button.cc b/ui/views/controls/button/label_button.cc
index d74fc8dbe0e57ed754635d9d56a23c36747b9e8a..7d25701b12f8954488a1b7730a3eb1f5c68854fe 100644
--- a/ui/views/controls/button/label_button.cc
+++ b/ui/views/controls/button/label_button.cc
@@ -433,12 +433,12 @@ void LabelButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
}
std::unique_ptr<InkDrop> LabelButton::CreateInkDrop() {
- return UseFloodFillInkDrop() ? CreateDefaultFloodFillInkDropImpl()
- : CustomButton::CreateInkDrop();
+ return ShouldUseFloodFillInkDrop() ? CreateDefaultFloodFillInkDropImpl()
+ : CustomButton::CreateInkDrop();
}
std::unique_ptr<views::InkDropRipple> LabelButton::CreateInkDropRipple() const {
- return UseFloodFillInkDrop()
+ return ShouldUseFloodFillInkDrop()
? base::MakeUnique<views::FloodFillInkDropRipple>(
size(), GetInkDropCenterBasedOnLastEvent(),
GetInkDropBaseColor(), ink_drop_visible_opacity())
@@ -448,7 +448,7 @@ std::unique_ptr<views::InkDropRipple> LabelButton::CreateInkDropRipple() const {
std::unique_ptr<views::InkDropHighlight> LabelButton::CreateInkDropHighlight()
const {
- return UseFloodFillInkDrop()
+ return ShouldUseFloodFillInkDrop()
? base::MakeUnique<views::InkDropHighlight>(
size(), kInkDropSmallCornerRadius,
gfx::RectF(GetLocalBounds()).CenterPoint(),
@@ -562,6 +562,10 @@ gfx::Rect LabelButton::GetThemePaintRect() const {
return GetLocalBounds();
}
+bool LabelButton::ShouldUseFloodFillInkDrop() const {
+ return !GetText().empty();
+}
+
ui::NativeTheme::State LabelButton::GetThemeState(
ui::NativeTheme::ExtraParams* params) const {
GetExtraParams(params);
@@ -605,8 +609,4 @@ void LabelButton::ResetLabelEnabledColor() {
label_->SetEnabledColor(color);
}
-bool LabelButton::UseFloodFillInkDrop() const {
- return !GetText().empty();
-}
-
} // namespace views
« ui/views/controls/button/label_button.h ('K') | « ui/views/controls/button/label_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698