| 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::OverridesHighlight() const { | |
| 157 return false; | |
| 158 } | |
| 159 | |
| 160 void FloodFillInkDropRipple::AnimateStateChange( | 156 void FloodFillInkDropRipple::AnimateStateChange( |
| 161 InkDropState old_ink_drop_state, | 157 InkDropState old_ink_drop_state, |
| 162 InkDropState new_ink_drop_state, | 158 InkDropState new_ink_drop_state, |
| 163 ui::LayerAnimationObserver* animation_observer) { | 159 ui::LayerAnimationObserver* animation_observer) { |
| 164 switch (new_ink_drop_state) { | 160 switch (new_ink_drop_state) { |
| 165 case InkDropState::HIDDEN: | 161 case InkDropState::HIDDEN: |
| 166 if (!IsVisible()) { | 162 if (!IsVisible()) { |
| 167 SetStateToHidden(); | 163 SetStateToHidden(); |
| 168 } else { | 164 } else { |
| 169 AnimateToOpacity(kHiddenOpacity, GetAnimationDuration(HIDDEN_FADE_OUT), | 165 AnimateToOpacity(kHiddenOpacity, GetAnimationDuration(HIDDEN_FADE_OUT), |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 (bounds.bottom_right() - point).Length(); | 329 (bounds.bottom_right() - point).Length(); |
| 334 | 330 |
| 335 float largest_distance = | 331 float largest_distance = |
| 336 std::max(distance_to_top_left, distance_to_top_right); | 332 std::max(distance_to_top_left, distance_to_top_right); |
| 337 largest_distance = std::max(largest_distance, distance_to_bottom_left); | 333 largest_distance = std::max(largest_distance, distance_to_bottom_left); |
| 338 largest_distance = std::max(largest_distance, distance_to_bottom_right); | 334 largest_distance = std::max(largest_distance, distance_to_bottom_right); |
| 339 return largest_distance; | 335 return largest_distance; |
| 340 } | 336 } |
| 341 | 337 |
| 342 } // namespace views | 338 } // namespace views |
| OLD | NEW |