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

Side by Side Diff: ui/wm/core/window_animations.cc

Issue 2020563006: [Merge to M51] Fix the issue that Apps window keeps moving down to the right when reopened. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 6 months 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
« no previous file with comments | « ui/wm/core/visibility_controller_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/wm/core/window_animations.h" 5 #include "ui/wm/core/window_animations.h"
6 6
7 #include <math.h> 7 #include <math.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <vector> 10 #include <vector>
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 aura::Window* topmost_transient_child = NULL; 97 aura::Window* topmost_transient_child = NULL;
98 for (++iter; iter != window_->parent()->children().end(); ++iter) { 98 for (++iter; iter != window_->parent()->children().end(); ++iter) {
99 if (ContainsValue(transient_children, *iter)) 99 if (ContainsValue(transient_children, *iter))
100 topmost_transient_child = *iter; 100 topmost_transient_child = *iter;
101 } 101 }
102 if (topmost_transient_child) { 102 if (topmost_transient_child) {
103 window_->parent()->layer()->StackAbove( 103 window_->parent()->layer()->StackAbove(
104 layer_owner_->root(), topmost_transient_child->layer()); 104 layer_owner_->root(), topmost_transient_child->layer());
105 } 105 }
106 } 106 }
107 // Reset the transform for the |window_|. Because the animation may have
108 // changed the transform, when recreating the layers we need to reset the
109 // transform otherwise the recreated layer has the transform installed
110 // for the animation.
111 window_->layer()->SetTransform(gfx::Transform());
107 } 112 }
108 113
109 protected: 114 protected:
110 // Invoked when the hiding animation is completed. It will delete 115 // Invoked when the hiding animation is completed. It will delete
111 // 'this', and no operation should be made on this object after this 116 // 'this', and no operation should be made on this object after this
112 // point. 117 // point.
113 void OnAnimationCompleted() { 118 void OnAnimationCompleted() {
114 // Window may have been destroyed by this point. 119 // Window may have been destroyed by this point.
115 if (window_) { 120 if (window_) {
116 aura::client::AnimationHost* animation_host = 121 aura::client::AnimationHost* animation_host =
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 // being accessed via Remote Desktop. 662 // being accessed via Remote Desktop.
658 if (ui::ScopedAnimationDurationScaleMode::duration_scale_mode() == 663 if (ui::ScopedAnimationDurationScaleMode::duration_scale_mode() ==
659 ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION) 664 ui::ScopedAnimationDurationScaleMode::NON_ZERO_DURATION)
660 return false; 665 return false;
661 666
662 // Let the user decide whether or not to play the animation. 667 // Let the user decide whether or not to play the animation.
663 return !gfx::Animation::ShouldRenderRichAnimation(); 668 return !gfx::Animation::ShouldRenderRichAnimation();
664 } 669 }
665 670
666 } // namespace wm 671 } // namespace wm
OLDNEW
« no previous file with comments | « ui/wm/core/visibility_controller_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698