| 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/ink_drop_host_view.h" | 5 #include "ui/views/animation/ink_drop_host_view.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "ui/events/event.h" | 8 #include "ui/events/event.h" |
| 9 #include "ui/events/scoped_target_handler.h" | 9 #include "ui/events/scoped_target_handler.h" |
| 10 #include "ui/gfx/color_palette.h" | 10 #include "ui/gfx/color_palette.h" |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 return; | 213 return; |
| 214 #endif | 214 #endif |
| 215 last_ripple_triggering_event_.reset( | 215 last_ripple_triggering_event_.reset( |
| 216 event ? ui::Event::Clone(*event).release()->AsLocatedEvent() : nullptr); | 216 event ? ui::Event::Clone(*event).release()->AsLocatedEvent() : nullptr); |
| 217 GetInkDrop()->AnimateToState(state); | 217 GetInkDrop()->AnimateToState(state); |
| 218 } | 218 } |
| 219 | 219 |
| 220 void InkDropHostView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 220 void InkDropHostView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
| 221 if (ink_drop_) | 221 if (ink_drop_) |
| 222 ink_drop_->HostSizeChanged(size()); | 222 ink_drop_->HostSizeChanged(size()); |
| 223 if (ink_drop_mask_) |
| 224 ink_drop_mask_->UpdateLayerSize(size()); |
| 223 } | 225 } |
| 224 | 226 |
| 225 void InkDropHostView::VisibilityChanged(View* starting_from, bool is_visible) { | 227 void InkDropHostView::VisibilityChanged(View* starting_from, bool is_visible) { |
| 226 View::VisibilityChanged(starting_from, is_visible); | 228 View::VisibilityChanged(starting_from, is_visible); |
| 227 if (GetWidget() && !is_visible) { | 229 if (GetWidget() && !is_visible) { |
| 228 GetInkDrop()->AnimateToState(InkDropState::HIDDEN); | 230 GetInkDrop()->AnimateToState(InkDropState::HIDDEN); |
| 229 GetInkDrop()->SetHovered(false); | 231 GetInkDrop()->SetHovered(false); |
| 230 } | 232 } |
| 231 } | 233 } |
| 232 | 234 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 std::unique_ptr<InkDropImpl> | 289 std::unique_ptr<InkDropImpl> |
| 288 InkDropHostView::CreateDefaultFloodFillInkDropImpl() { | 290 InkDropHostView::CreateDefaultFloodFillInkDropImpl() { |
| 289 std::unique_ptr<views::InkDropImpl> ink_drop = | 291 std::unique_ptr<views::InkDropImpl> ink_drop = |
| 290 InkDropHostView::CreateDefaultInkDropImpl(); | 292 InkDropHostView::CreateDefaultInkDropImpl(); |
| 291 ink_drop->SetAutoHighlightMode( | 293 ink_drop->SetAutoHighlightMode( |
| 292 views::InkDropImpl::AutoHighlightMode::SHOW_ON_RIPPLE); | 294 views::InkDropImpl::AutoHighlightMode::SHOW_ON_RIPPLE); |
| 293 return ink_drop; | 295 return ink_drop; |
| 294 } | 296 } |
| 295 | 297 |
| 296 } // namespace views | 298 } // namespace views |
| OLD | NEW |