| OLD | NEW |
| 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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 SetOpacity(visible_opacity_); | 225 SetOpacity(visible_opacity_); |
| 226 InkDropTransforms transforms; | 226 InkDropTransforms transforms; |
| 227 GetActivatedTargetTransforms(&transforms); | 227 GetActivatedTargetTransforms(&transforms); |
| 228 SetTransforms(transforms); | 228 SetTransforms(transforms); |
| 229 } | 229 } |
| 230 | 230 |
| 231 ui::Layer* SquareInkDropRipple::GetRootLayer() { | 231 ui::Layer* SquareInkDropRipple::GetRootLayer() { |
| 232 return &root_layer_; | 232 return &root_layer_; |
| 233 } | 233 } |
| 234 | 234 |
| 235 bool SquareInkDropRipple::OverridesHighlight() const { | |
| 236 return true; | |
| 237 } | |
| 238 | |
| 239 float SquareInkDropRipple::GetCurrentOpacity() const { | 235 float SquareInkDropRipple::GetCurrentOpacity() const { |
| 240 return root_layer_.opacity(); | 236 return root_layer_.opacity(); |
| 241 } | 237 } |
| 242 | 238 |
| 243 std::string SquareInkDropRipple::ToLayerName(PaintedShape painted_shape) { | 239 std::string SquareInkDropRipple::ToLayerName(PaintedShape painted_shape) { |
| 244 switch (painted_shape) { | 240 switch (painted_shape) { |
| 245 case TOP_LEFT_CIRCLE: | 241 case TOP_LEFT_CIRCLE: |
| 246 return "TOP_LEFT_CIRCLE"; | 242 return "TOP_LEFT_CIRCLE"; |
| 247 case TOP_RIGHT_CIRCLE: | 243 case TOP_RIGHT_CIRCLE: |
| 248 return "TOP_RIGHT_CIRCLE"; | 244 return "TOP_RIGHT_CIRCLE"; |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 layer->set_delegate(delegate); | 639 layer->set_delegate(delegate); |
| 644 layer->SetVisible(true); | 640 layer->SetVisible(true); |
| 645 layer->SetOpacity(1.0); | 641 layer->SetOpacity(1.0); |
| 646 layer->SetMasksToBounds(false); | 642 layer->SetMasksToBounds(false); |
| 647 layer->set_name("PAINTED_SHAPE_COUNT:" + ToLayerName(painted_shape)); | 643 layer->set_name("PAINTED_SHAPE_COUNT:" + ToLayerName(painted_shape)); |
| 648 | 644 |
| 649 painted_layers_[painted_shape].reset(layer); | 645 painted_layers_[painted_shape].reset(layer); |
| 650 } | 646 } |
| 651 | 647 |
| 652 } // namespace views | 648 } // namespace views |
| OLD | NEW |