OLD | NEW |
---|---|
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 12 matching lines...) Expand all Loading... | |
23 #include "ui/aura/env.h" | 23 #include "ui/aura/env.h" |
24 #include "ui/aura/layout_manager.h" | 24 #include "ui/aura/layout_manager.h" |
25 #include "ui/aura/window_delegate.h" | 25 #include "ui/aura/window_delegate.h" |
26 #include "ui/aura/window_event_dispatcher.h" | 26 #include "ui/aura/window_event_dispatcher.h" |
27 #include "ui/aura/window_observer.h" | 27 #include "ui/aura/window_observer.h" |
28 #include "ui/aura/window_tracker.h" | 28 #include "ui/aura/window_tracker.h" |
29 #include "ui/aura/window_tree_host.h" | 29 #include "ui/aura/window_tree_host.h" |
30 #include "ui/compositor/compositor.h" | 30 #include "ui/compositor/compositor.h" |
31 #include "ui/compositor/layer.h" | 31 #include "ui/compositor/layer.h" |
32 #include "ui/events/event_target_iterator.h" | 32 #include "ui/events/event_target_iterator.h" |
33 #include "ui/gfx/animation/multi_animation.h" | |
34 #include "ui/gfx/canvas.h" | 33 #include "ui/gfx/canvas.h" |
35 #include "ui/gfx/path.h" | 34 #include "ui/gfx/path.h" |
36 #include "ui/gfx/scoped_canvas.h" | 35 #include "ui/gfx/scoped_canvas.h" |
37 #include "ui/gfx/screen.h" | 36 #include "ui/gfx/screen.h" |
38 | 37 |
39 namespace aura { | 38 namespace aura { |
40 | 39 |
41 namespace { | 40 namespace { |
42 | 41 |
43 ui::LayerType WindowLayerTypeToUILayerType(WindowLayerType window_layer_type) { | 42 ui::LayerType WindowLayerTypeToUILayerType(WindowLayerType window_layer_type) { |
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1009 return_tightest, | 1008 return_tightest, |
1010 for_event_handling); | 1009 for_event_handling); |
1011 if (match) | 1010 if (match) |
1012 return match; | 1011 return match; |
1013 } | 1012 } |
1014 | 1013 |
1015 return delegate_ ? this : NULL; | 1014 return delegate_ ? this : NULL; |
1016 } | 1015 } |
1017 | 1016 |
1018 void Window::RemoveChildImpl(Window* child, Window* new_parent) { | 1017 void Window::RemoveChildImpl(Window* child, Window* new_parent) { |
1018 if (child->layer() && child->layer()->GetAnimator()) | |
sky
2014/04/24 16:06:19
Add a comment as to why we do this.
varkha
2014/04/24 18:47:18
Done.
| |
1019 child->layer()->GetAnimator()->StopAnimating(); | |
1019 if (layout_manager_) | 1020 if (layout_manager_) |
1020 layout_manager_->OnWillRemoveWindowFromLayout(child); | 1021 layout_manager_->OnWillRemoveWindowFromLayout(child); |
1021 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWillRemoveWindow(child)); | 1022 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWillRemoveWindow(child)); |
1022 Window* root_window = child->GetRootWindow(); | 1023 Window* root_window = child->GetRootWindow(); |
1023 Window* new_root_window = new_parent ? new_parent->GetRootWindow() : NULL; | 1024 Window* new_root_window = new_parent ? new_parent->GetRootWindow() : NULL; |
1024 if (root_window && root_window != new_root_window) | 1025 if (root_window && root_window != new_root_window) |
1025 child->NotifyRemovingFromRootWindow(new_root_window); | 1026 child->NotifyRemovingFromRootWindow(new_root_window); |
1026 | 1027 |
1027 gfx::Vector2d offset; | 1028 gfx::Vector2d offset; |
1028 GetAncestorWithLayer(&offset); | 1029 GetAncestorWithLayer(&offset); |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1437 return window; | 1438 return window; |
1438 if (offset) | 1439 if (offset) |
1439 *offset += window->bounds().OffsetFromOrigin(); | 1440 *offset += window->bounds().OffsetFromOrigin(); |
1440 } | 1441 } |
1441 if (offset) | 1442 if (offset) |
1442 *offset = gfx::Vector2d(); | 1443 *offset = gfx::Vector2d(); |
1443 return NULL; | 1444 return NULL; |
1444 } | 1445 } |
1445 | 1446 |
1446 } // namespace aura | 1447 } // namespace aura |
OLD | NEW |