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/wm/core/window_util.h" | 5 #include "ui/wm/core/window_util.h" |
6 | 6 |
7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
8 #include "ui/compositor/layer.h" | 8 #include "ui/compositor/layer.h" |
9 #include "ui/compositor/layer_tree_owner.h" | 9 #include "ui/compositor/layer_tree_owner.h" |
10 #include "ui/wm/core/transient_window_manager.h" | 10 #include "ui/wm/core/transient_window_manager.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 aura::client::GetActivationClient(window->GetRootWindow()); | 73 aura::client::GetActivationClient(window->GetRootWindow()); |
74 return client ? client->GetActivatableWindow(window) : NULL; | 74 return client ? client->GetActivatableWindow(window) : NULL; |
75 } | 75 } |
76 | 76 |
77 aura::Window* GetToplevelWindow(aura::Window* window) { | 77 aura::Window* GetToplevelWindow(aura::Window* window) { |
78 aura::client::ActivationClient* client = | 78 aura::client::ActivationClient* client = |
79 aura::client::GetActivationClient(window->GetRootWindow()); | 79 aura::client::GetActivationClient(window->GetRootWindow()); |
80 return client ? client->GetToplevelWindow(window) : NULL; | 80 return client ? client->GetToplevelWindow(window) : NULL; |
81 } | 81 } |
82 | 82 |
83 scoped_ptr<ui::LayerTreeOwner> RecreateLayers(ui::LayerOwner* root) { | 83 std::unique_ptr<ui::LayerTreeOwner> RecreateLayers(ui::LayerOwner* root) { |
84 scoped_ptr<ui::LayerTreeOwner> old_layer( | 84 std::unique_ptr<ui::LayerTreeOwner> old_layer( |
85 new ui::LayerTreeOwner(root->RecreateLayer().release())); | 85 new ui::LayerTreeOwner(root->RecreateLayer().release())); |
86 if (old_layer->root()) | 86 if (old_layer->root()) |
87 CloneChildren(root->layer(), old_layer->root()); | 87 CloneChildren(root->layer(), old_layer->root()); |
88 return old_layer; | 88 return old_layer; |
89 } | 89 } |
90 | 90 |
91 aura::Window* GetTransientParent(aura::Window* window) { | 91 aura::Window* GetTransientParent(aura::Window* window) { |
92 return const_cast<aura::Window*>(GetTransientParent( | 92 return const_cast<aura::Window*>(GetTransientParent( |
93 const_cast<const aura::Window*>(window))); | 93 const_cast<const aura::Window*>(window))); |
94 } | 94 } |
(...skipping 24 matching lines...) Expand all Loading... |
119 bool HasTransientAncestor(const aura::Window* window, | 119 bool HasTransientAncestor(const aura::Window* window, |
120 const aura::Window* ancestor) { | 120 const aura::Window* ancestor) { |
121 const aura::Window* transient_parent = GetTransientParent(window); | 121 const aura::Window* transient_parent = GetTransientParent(window); |
122 if (transient_parent == ancestor) | 122 if (transient_parent == ancestor) |
123 return true; | 123 return true; |
124 return transient_parent ? | 124 return transient_parent ? |
125 HasTransientAncestor(transient_parent, ancestor) : false; | 125 HasTransientAncestor(transient_parent, ancestor) : false; |
126 } | 126 } |
127 | 127 |
128 } // namespace wm | 128 } // namespace wm |
OLD | NEW |