| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "services/ui/ws/window_tree.h" | 5 #include "services/ui/ws/window_tree.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 976 // don't have to worry about whether |created_window_map_| changes or not. | 976 // don't have to worry about whether |created_window_map_| changes or not. |
| 977 base::hash_map<WindowId, ServerWindow*> created_window_map_copy; | 977 base::hash_map<WindowId, ServerWindow*> created_window_map_copy; |
| 978 created_window_map_.swap(created_window_map_copy); | 978 created_window_map_.swap(created_window_map_copy); |
| 979 // A sibling can be a transient parent of another window so we detach windows | 979 // A sibling can be a transient parent of another window so we detach windows |
| 980 // from their transient parents to avoid double deletes. | 980 // from their transient parents to avoid double deletes. |
| 981 for (auto& pair : created_window_map_copy) { | 981 for (auto& pair : created_window_map_copy) { |
| 982 ServerWindow* transient_parent = pair.second->transient_parent(); | 982 ServerWindow* transient_parent = pair.second->transient_parent(); |
| 983 if (transient_parent) | 983 if (transient_parent) |
| 984 transient_parent->RemoveTransientWindow(pair.second); | 984 transient_parent->RemoveTransientWindow(pair.second); |
| 985 } | 985 } |
| 986 STLDeleteValues(&created_window_map_copy); | 986 base::STLDeleteValues(&created_window_map_copy); |
| 987 } | 987 } |
| 988 | 988 |
| 989 bool WindowTree::CanEmbed(const ClientWindowId& window_id) const { | 989 bool WindowTree::CanEmbed(const ClientWindowId& window_id) const { |
| 990 const ServerWindow* window = GetWindowByClientId(window_id); | 990 const ServerWindow* window = GetWindowByClientId(window_id); |
| 991 return window && access_policy_->CanEmbed(window); | 991 return window && access_policy_->CanEmbed(window); |
| 992 } | 992 } |
| 993 | 993 |
| 994 void WindowTree::PrepareForEmbed(ServerWindow* window) { | 994 void WindowTree::PrepareForEmbed(ServerWindow* window) { |
| 995 DCHECK(window); | 995 DCHECK(window); |
| 996 | 996 |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1674 } | 1674 } |
| 1675 | 1675 |
| 1676 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( | 1676 bool WindowTree::IsWindowRootOfAnotherTreeForAccessPolicy( |
| 1677 const ServerWindow* window) const { | 1677 const ServerWindow* window) const { |
| 1678 WindowTree* tree = window_server_->GetTreeWithRoot(window); | 1678 WindowTree* tree = window_server_->GetTreeWithRoot(window); |
| 1679 return tree && tree != this; | 1679 return tree && tree != this; |
| 1680 } | 1680 } |
| 1681 | 1681 |
| 1682 } // namespace ws | 1682 } // namespace ws |
| 1683 } // namespace ui | 1683 } // namespace ui |
| OLD | NEW |