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

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

Issue 2533053002: Handle view resize for ripple (Closed)
Patch Set: const -> constexpr Created 4 years 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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_impl.h" 5 #include "ui/views/animation/ink_drop_impl.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/timer/timer.h" 8 #include "base/timer/timer.h"
9 #include "ui/compositor/layer.h" 9 #include "ui/compositor/layer.h"
10 #include "ui/views/animation/ink_drop_highlight.h" 10 #include "ui/views/animation/ink_drop_highlight.h"
(...skipping 608 matching lines...) Expand 10 before | Expand all | Expand 10 after
619 highlight_state_factory_ = 619 highlight_state_factory_ =
620 base::MakeUnique<HighlightStateFactory>(auto_highlight_mode, this); 620 base::MakeUnique<HighlightStateFactory>(auto_highlight_mode, this);
621 SetHighlightState(highlight_state_factory_->CreateStartState()); 621 SetHighlightState(highlight_state_factory_->CreateStartState());
622 } 622 }
623 623
624 void InkDropImpl::HostSizeChanged(const gfx::Size& new_size) { 624 void InkDropImpl::HostSizeChanged(const gfx::Size& new_size) {
625 // |root_layer_| should fill the entire host because it affects the clipping 625 // |root_layer_| should fill the entire host because it affects the clipping
626 // when a mask layer is applied to it. This will not affect clipping if no 626 // when a mask layer is applied to it. This will not affect clipping if no
627 // mask layer is set. 627 // mask layer is set.
628 root_layer_->SetBounds(gfx::Rect(new_size)); 628 root_layer_->SetBounds(gfx::Rect(new_size));
629 if (ink_drop_ripple_)
630 ink_drop_ripple_->HostSizeChanged(new_size);
629 } 631 }
630 632
631 InkDropState InkDropImpl::GetTargetInkDropState() const { 633 InkDropState InkDropImpl::GetTargetInkDropState() const {
632 if (!ink_drop_ripple_) 634 if (!ink_drop_ripple_)
633 return InkDropState::HIDDEN; 635 return InkDropState::HIDDEN;
634 return ink_drop_ripple_->target_ink_drop_state(); 636 return ink_drop_ripple_->target_ink_drop_state();
635 } 637 }
636 638
637 void InkDropImpl::AnimateToState(InkDropState ink_drop_state) { 639 void InkDropImpl::AnimateToState(InkDropState ink_drop_state) {
638 // Never animate hidden -> hidden, since that will add layers which may never 640 // Never animate hidden -> hidden, since that will add layers which may never
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
811 "within a call to " 813 "within a call to "
812 "HighlightState::Exit()."; 814 "HighlightState::Exit().";
813 if (highlight_state_) { 815 if (highlight_state_) {
814 base::AutoReset<bool> exit_guard(&exiting_highlight_state_, true); 816 base::AutoReset<bool> exit_guard(&exiting_highlight_state_, true);
815 highlight_state_->Exit(); 817 highlight_state_->Exit();
816 } 818 }
817 highlight_state_ = nullptr; 819 highlight_state_ = nullptr;
818 } 820 }
819 821
820 } // namespace views 822 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/animation/flood_fill_ink_drop_ripple_unittest.cc ('k') | ui/views/animation/ink_drop_ripple.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698