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

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: Rebased Created 4 years, 5 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 235
236 SkColor InkDropHostView::GetInkDropBaseColor() const { 236 SkColor InkDropHostView::GetInkDropBaseColor() const {
237 NOTREACHED(); 237 NOTREACHED();
238 return gfx::kPlaceholderColor; 238 return gfx::kPlaceholderColor;
239 } 239 }
240 240
241 bool InkDropHostView::ShouldShowInkDropForFocus() const { 241 bool InkDropHostView::ShouldShowInkDropForFocus() const {
242 return false; 242 return false;
243 } 243 }
244 244
245 void InkDropHostView::SetHasInkDrop(bool has_an_ink_drop) { 245 void InkDropHostView::SetInkDropMode(InkDropMode ink_drop_mode) {
246 if (has_an_ink_drop) { 246 if (ink_drop_mode == InkDropMode::OFF)
247 ink_drop_.reset(new InkDropStub());
248 else
247 ink_drop_.reset(new InkDropImpl(this)); 249 ink_drop_.reset(new InkDropImpl(this));
248 if (!gesture_handler_) 250
251 if (ink_drop_mode == InkDropMode::ON) {
252 if (gesture_handler_)
253 gesture_handler_->SetInkDrop(ink_drop_.get());
254 else
249 gesture_handler_.reset(new InkDropGestureHandler(this, ink_drop_.get())); 255 gesture_handler_.reset(new InkDropGestureHandler(this, ink_drop_.get()));
250 else
251 gesture_handler_->SetInkDrop(ink_drop_.get());
252 } else { 256 } else {
253 gesture_handler_.reset(); 257 gesture_handler_.reset();
254 ink_drop_.reset(new InkDropStub());
255 } 258 }
256 } 259 }
257 260
258 } // namespace views 261 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/ink_drop_host_view.h ('k') | ui/views/animation/ink_drop_host_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698