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

Side by Side Diff: ui/views/animation/ink_drop_host_view.cc

Issue 2070143003: Add MD ink drop ripple to app list button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b612539_shelf_button_ripple
Patch Set: Added tests + Addressed review comments Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #include "ui/views/animation/ink_drop_host_view.h" 5 #include "ui/views/animation/ink_drop_host_view.h"
6 6
7 #include "ui/events/event.h" 7 #include "ui/events/event.h"
8 #include "ui/events/scoped_target_handler.h" 8 #include "ui/events/scoped_target_handler.h"
9 #include "ui/gfx/color_palette.h" 9 #include "ui/gfx/color_palette.h"
10 #include "ui/gfx/geometry/size_conversions.h" 10 #include "ui/gfx/geometry/size_conversions.h"
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 SkColor InkDropHostView::GetInkDropBaseColor() const { 186 SkColor InkDropHostView::GetInkDropBaseColor() const {
187 NOTREACHED(); 187 NOTREACHED();
188 return gfx::kPlaceholderColor; 188 return gfx::kPlaceholderColor;
189 } 189 }
190 190
191 bool InkDropHostView::ShouldShowInkDropForFocus() const { 191 bool InkDropHostView::ShouldShowInkDropForFocus() const {
192 return false; 192 return false;
193 } 193 }
194 194
195 void InkDropHostView::SetHasInkDrop(bool has_an_ink_drop) { 195 void InkDropHostView::SetHasInkDrop(bool has_an_ink_drop) {
196 bool handles_gesture_event = has_an_ink_drop;
197 SetHasInkDrop(has_an_ink_drop, handles_gesture_event);
198 }
199
200 void InkDropHostView::SetHasInkDrop(bool has_an_ink_drop,
201 bool handles_gesture_event) {
196 if (has_an_ink_drop) { 202 if (has_an_ink_drop) {
197 ink_drop_.reset(new InkDropImpl(this)); 203 ink_drop_.reset(new InkDropImpl(this));
198 gesture_handler_.reset(new InkDropGestureHandler(this, ink_drop_.get())); 204 if (handles_gesture_event)
205 gesture_handler_.reset(new InkDropGestureHandler(this, ink_drop_.get()));
206 else
207 gesture_handler_.reset();
199 } else { 208 } else {
209 DCHECK(!handles_gesture_event);
200 gesture_handler_.reset(); 210 gesture_handler_.reset();
201 ink_drop_.reset(new InkDropStub()); 211 ink_drop_.reset(new InkDropStub());
202 } 212 }
203 } 213 }
204 214
205 void InkDropHostView::AnimateInkDrop(InkDropState ink_drop_state) { 215 void InkDropHostView::AnimateInkDrop(InkDropState ink_drop_state) {
206 ink_drop_->AnimateToState(ink_drop_state); 216 ink_drop_->AnimateToState(ink_drop_state);
207 } 217 }
208 218
209 } // namespace views 219 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698