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

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

Issue 2250783002: Allow InkDropRipple to co-exist with highlight (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove EmptyInkDropRipple Created 4 years, 3 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/square_ink_drop_ripple.h" 5 #include "ui/views/animation/square_ink_drop_ripple.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/compositor/layer.h" 10 #include "ui/compositor/layer.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 SetOpacity(visible_opacity_); 207 SetOpacity(visible_opacity_);
208 InkDropTransforms transforms; 208 InkDropTransforms transforms;
209 GetActivatedTargetTransforms(&transforms); 209 GetActivatedTargetTransforms(&transforms);
210 SetTransforms(transforms); 210 SetTransforms(transforms);
211 } 211 }
212 212
213 ui::Layer* SquareInkDropRipple::GetRootLayer() { 213 ui::Layer* SquareInkDropRipple::GetRootLayer() {
214 return &root_layer_; 214 return &root_layer_;
215 } 215 }
216 216
217 bool SquareInkDropRipple::IsVisible() const { 217 bool SquareInkDropRipple::OverridesHighlight() const {
218 return root_layer_.visible(); 218 return true;
219 } 219 }
220 220
221 float SquareInkDropRipple::GetCurrentOpacity() const { 221 float SquareInkDropRipple::GetCurrentOpacity() const {
222 return root_layer_.opacity(); 222 return root_layer_.opacity();
223 } 223 }
224 224
225 std::string SquareInkDropRipple::ToLayerName(PaintedShape painted_shape) { 225 std::string SquareInkDropRipple::ToLayerName(PaintedShape painted_shape) {
226 switch (painted_shape) { 226 switch (painted_shape) {
227 case TOP_LEFT_CIRCLE: 227 case TOP_LEFT_CIRCLE:
228 return "TOP_LEFT_CIRCLE"; 228 return "TOP_LEFT_CIRCLE";
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 layer->set_delegate(delegate); 573 layer->set_delegate(delegate);
574 layer->SetVisible(true); 574 layer->SetVisible(true);
575 layer->SetOpacity(1.0); 575 layer->SetOpacity(1.0);
576 layer->SetMasksToBounds(false); 576 layer->SetMasksToBounds(false);
577 layer->set_name("PAINTED_SHAPE_COUNT:" + ToLayerName(painted_shape)); 577 layer->set_name("PAINTED_SHAPE_COUNT:" + ToLayerName(painted_shape));
578 578
579 painted_layers_[painted_shape].reset(layer); 579 painted_layers_[painted_shape].reset(layer);
580 } 580 }
581 581
582 } // namespace views 582 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/square_ink_drop_ripple.h ('k') | ui/views/animation/test/test_ink_drop_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698