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

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

Issue 2447523002: [ash-md] Added different highlighting modes to the InkDropImpl. (Closed)
Patch Set: Fixed InkDropHostView::GetInkDrop() to use CreateInkDrop(). Created 4 years, 1 month 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
« no previous file with comments | « ui/views/controls/button/checkbox.h ('k') | ui/views/controls/button/custom_button.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/checkbox.cc
diff --git a/ui/views/controls/button/checkbox.cc b/ui/views/controls/button/checkbox.cc
index 353532decc9401a1b7a5979c01b49a25c66c6988..f07b748488138b6cb4e1f5c5f9a3acb576ac8e03 100644
--- a/ui/views/controls/button/checkbox.cc
+++ b/ui/views/controls/button/checkbox.cc
@@ -16,8 +16,8 @@
#include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/vector_icons_public.h"
#include "ui/resources/grit/ui_resources.h"
-#include "ui/views/animation/ink_drop_highlight.h"
#include "ui/views/animation/ink_drop_ripple.h"
+#include "ui/views/animation/square_ink_drop_ripple.h"
#include "ui/views/controls/button/label_button_border.h"
#include "ui/views/painter.h"
#include "ui/views/resources/grit/views_resources.h"
@@ -39,8 +39,6 @@ Checkbox::Checkbox(const base::string16& label)
SetInkDropMode(PlatformStyle::kUseRipples ? InkDropMode::ON
: InkDropMode::OFF);
set_has_ink_drop_action_on_click(true);
- // The "small" size is 21dp, the large size is 1.33 * 21dp = 28dp.
- set_ink_drop_size(gfx::Size(21, 21));
SetFocusPainter(nullptr);
} else {
std::unique_ptr<LabelButtonBorder> button_border(new LabelButtonBorder());
@@ -165,11 +163,13 @@ void Checkbox::OnNativeThemeChanged(const ui::NativeTheme* theme) {
}
std::unique_ptr<InkDropRipple> Checkbox::CreateInkDropRipple() const {
- return CreateDefaultInkDropRipple(image()->GetMirroredBounds().CenterPoint());
-}
-
-std::unique_ptr<InkDropHighlight> Checkbox::CreateInkDropHighlight() const {
- return nullptr;
+ // The "small" size is 21dp, the large size is 1.33 * 21dp = 28dp.
+ const gfx::Size size(21, 21);
+ std::unique_ptr<InkDropRipple> ripple(new SquareInkDropRipple(
+ CalculateLargeInkDropSize(size), kInkDropLargeCornerRadius, size,
+ kInkDropSmallCornerRadius, image()->GetMirroredBounds().CenterPoint(),
+ GetInkDropBaseColor(), ink_drop_visible_opacity()));
+ return ripple;
}
SkColor Checkbox::GetInkDropBaseColor() const {
« no previous file with comments | « ui/views/controls/button/checkbox.h ('k') | ui/views/controls/button/custom_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698