| 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/flood_fill_ink_drop_ripple.h" | 5 #include "ui/views/animation/flood_fill_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 "third_party/skia/include/core/SkColor.h" | 10 #include "third_party/skia/include/core/SkColor.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 void FloodFillInkDropRipple::SnapToActivated() { | 146 void FloodFillInkDropRipple::SnapToActivated() { |
| 147 InkDropRipple::SnapToActivated(); | 147 InkDropRipple::SnapToActivated(); |
| 148 SetOpacity(visible_opacity_); | 148 SetOpacity(visible_opacity_); |
| 149 painted_layer_.SetTransform(GetMaxSizeTargetTransform()); | 149 painted_layer_.SetTransform(GetMaxSizeTargetTransform()); |
| 150 } | 150 } |
| 151 | 151 |
| 152 ui::Layer* FloodFillInkDropRipple::GetRootLayer() { | 152 ui::Layer* FloodFillInkDropRipple::GetRootLayer() { |
| 153 return &root_layer_; | 153 return &root_layer_; |
| 154 } | 154 } |
| 155 | 155 |
| 156 bool FloodFillInkDropRipple::IsVisible() const { | 156 bool FloodFillInkDropRipple::OverridesHighlight() const { |
| 157 return root_layer_.visible(); | 157 return false; |
| 158 } | 158 } |
| 159 | 159 |
| 160 void FloodFillInkDropRipple::AnimateStateChange( | 160 void FloodFillInkDropRipple::AnimateStateChange( |
| 161 InkDropState old_ink_drop_state, | 161 InkDropState old_ink_drop_state, |
| 162 InkDropState new_ink_drop_state, | 162 InkDropState new_ink_drop_state, |
| 163 ui::LayerAnimationObserver* animation_observer) { | 163 ui::LayerAnimationObserver* animation_observer) { |
| 164 switch (new_ink_drop_state) { | 164 switch (new_ink_drop_state) { |
| 165 case InkDropState::HIDDEN: | 165 case InkDropState::HIDDEN: |
| 166 if (!IsVisible()) { | 166 if (!IsVisible()) { |
| 167 SetStateToHidden(); | 167 SetStateToHidden(); |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 (bounds.bottom_right() - point).Length(); | 333 (bounds.bottom_right() - point).Length(); |
| 334 | 334 |
| 335 float largest_distance = | 335 float largest_distance = |
| 336 std::max(distance_to_top_left, distance_to_top_right); | 336 std::max(distance_to_top_left, distance_to_top_right); |
| 337 largest_distance = std::max(largest_distance, distance_to_bottom_left); | 337 largest_distance = std::max(largest_distance, distance_to_bottom_left); |
| 338 largest_distance = std::max(largest_distance, distance_to_bottom_right); | 338 largest_distance = std::max(largest_distance, distance_to_bottom_right); |
| 339 return largest_distance; | 339 return largest_distance; |
| 340 } | 340 } |
| 341 | 341 |
| 342 } // namespace views | 342 } // namespace views |
| OLD | NEW |