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

Unified Diff: ui/views/controls/button/toggle_button.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/toggle_button.h ('k') | ui/views/controls/combobox/combobox.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/toggle_button.cc
diff --git a/ui/views/controls/button/toggle_button.cc b/ui/views/controls/button/toggle_button.cc
index 342c350720e891058f42fc28ec0c05bd72c65b9a..8d02d0b838aa732697a6f3e5a7e9d1e0b87d4a26 100644
--- a/ui/views/controls/button/toggle_button.cc
+++ b/ui/views/controls/button/toggle_button.cc
@@ -10,6 +10,7 @@
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_palette.h"
#include "ui/gfx/color_utils.h"
+#include "ui/views/animation/ink_drop_impl.h"
#include "ui/views/animation/ink_drop_ripple.h"
#include "ui/views/border.h"
@@ -218,6 +219,13 @@ void ToggleButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
thumb_view_->RemoveInkDropLayer(ink_drop_layer);
}
+std::unique_ptr<InkDrop> ToggleButton::CreateInkDrop() {
+ std::unique_ptr<InkDropImpl> ink_drop =
+ CustomButton::CreateDefaultInkDropImpl();
+ ink_drop->SetShowHighlightOnHover(false);
+ return std::move(ink_drop);
+}
+
std::unique_ptr<InkDropRipple> ToggleButton::CreateInkDropRipple() const {
gfx::Rect rect = thumb_view_->GetLocalBounds();
rect.Inset(-ThumbView::GetShadowOutsets());
@@ -228,10 +236,6 @@ SkColor ToggleButton::GetInkDropBaseColor() const {
return GetTrackColor(is_on());
}
-bool ToggleButton::ShouldShowInkDropHighlight() const {
- return false;
-}
-
void ToggleButton::AnimationProgressed(const gfx::Animation* animation) {
if (animation == &slide_animation_) {
// TODO(varkha, estade): The thumb is using its own view. Investigate if
« no previous file with comments | « ui/views/controls/button/toggle_button.h ('k') | ui/views/controls/combobox/combobox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698