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

Side by Side Diff: ui/aura/window.cc

Issue 241983003: Stops animations when removing a window from its parent (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Stops animations when removing a layer from its parent and fixes broken test Created 6 years, 7 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 | Annotate | Revision Log
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/aura/window.h" 5 #include "ui/aura/window.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after
1000 return_tightest, 1000 return_tightest,
1001 for_event_handling); 1001 for_event_handling);
1002 if (match) 1002 if (match)
1003 return match; 1003 return match;
1004 } 1004 }
1005 1005
1006 return delegate_ ? this : NULL; 1006 return delegate_ ? this : NULL;
1007 } 1007 }
1008 1008
1009 void Window::RemoveChildImpl(Window* child, Window* new_parent) { 1009 void Window::RemoveChildImpl(Window* child, Window* new_parent) {
1010 // Stop (and complete) an ongoing animation to make sure bounds are updated
1011 // before updating the layers bounds again.
1012 if (child->layer() && child->layer()->GetAnimator())
1013 child->layer()->GetAnimator()->StopAnimating();
1014 if (layout_manager_) 1010 if (layout_manager_)
1015 layout_manager_->OnWillRemoveWindowFromLayout(child); 1011 layout_manager_->OnWillRemoveWindowFromLayout(child);
1016 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWillRemoveWindow(child)); 1012 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWillRemoveWindow(child));
1017 Window* root_window = child->GetRootWindow(); 1013 Window* root_window = child->GetRootWindow();
1018 Window* new_root_window = new_parent ? new_parent->GetRootWindow() : NULL; 1014 Window* new_root_window = new_parent ? new_parent->GetRootWindow() : NULL;
1019 if (root_window && root_window != new_root_window) 1015 if (root_window && root_window != new_root_window)
1020 child->NotifyRemovingFromRootWindow(new_root_window); 1016 child->NotifyRemovingFromRootWindow(new_root_window);
1021 1017
1022 gfx::Vector2d offset; 1018 gfx::Vector2d offset;
1023 GetAncestorWithLayer(&offset); 1019 GetAncestorWithLayer(&offset);
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
1432 return window; 1428 return window;
1433 if (offset) 1429 if (offset)
1434 *offset += window->bounds().OffsetFromOrigin(); 1430 *offset += window->bounds().OffsetFromOrigin();
1435 } 1431 }
1436 if (offset) 1432 if (offset)
1437 *offset = gfx::Vector2d(); 1433 *offset = gfx::Vector2d();
1438 return NULL; 1434 return NULL;
1439 } 1435 }
1440 1436
1441 } // namespace aura 1437 } // namespace aura
OLDNEW
« no previous file with comments | « ash/desktop_background/desktop_background_controller_unittest.cc ('k') | ui/compositor/layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698