| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/client/window_parenting_client.h" | 5 #include "ui/aura/client/window_parenting_client.h" |
| 6 | 6 |
| 7 #include "ui/aura/env.h" | 7 #include "ui/aura/env.h" |
| 8 #include "ui/aura/window.h" |
| 8 #include "ui/aura/window_event_dispatcher.h" | 9 #include "ui/aura/window_event_dispatcher.h" |
| 9 #include "ui/aura/window_property.h" | 10 #include "ui/base/class_property.h" |
| 10 | 11 |
| 11 DECLARE_WINDOW_PROPERTY_TYPE(aura::client::WindowParentingClient*) | 12 DECLARE_UI_CLASS_PROPERTY_TYPE(aura::client::WindowParentingClient*) |
| 12 | 13 |
| 13 namespace aura { | 14 namespace aura { |
| 14 namespace client { | 15 namespace client { |
| 15 | 16 |
| 16 DEFINE_WINDOW_PROPERTY_KEY(WindowParentingClient*, | 17 DEFINE_UI_CLASS_PROPERTY_KEY(WindowParentingClient*, |
| 17 kRootWindowWindowParentingClientKey, | 18 kRootWindowWindowParentingClientKey, |
| 18 NULL); | 19 NULL); |
| 19 | 20 |
| 20 void SetWindowParentingClient(Window* window, | 21 void SetWindowParentingClient(Window* window, |
| 21 WindowParentingClient* window_tree_client) { | 22 WindowParentingClient* window_tree_client) { |
| 22 DCHECK(window); | 23 DCHECK(window); |
| 23 | 24 |
| 24 Window* root_window = window->GetRootWindow(); | 25 Window* root_window = window->GetRootWindow(); |
| 25 DCHECK(root_window); | 26 DCHECK(root_window); |
| 26 root_window->SetProperty(kRootWindowWindowParentingClientKey, | 27 root_window->SetProperty(kRootWindowWindowParentingClientKey, |
| 27 window_tree_client); | 28 window_tree_client); |
| 28 } | 29 } |
| (...skipping 16 matching lines...) Expand all Loading... |
| 45 // |context| must be attached to a hierarchy with a WindowParentingClient. | 46 // |context| must be attached to a hierarchy with a WindowParentingClient. |
| 46 WindowParentingClient* client = GetWindowParentingClient(context); | 47 WindowParentingClient* client = GetWindowParentingClient(context); |
| 47 DCHECK(client); | 48 DCHECK(client); |
| 48 Window* default_parent = | 49 Window* default_parent = |
| 49 client->GetDefaultParent(context, window, screen_bounds); | 50 client->GetDefaultParent(context, window, screen_bounds); |
| 50 default_parent->AddChild(window); | 51 default_parent->AddChild(window); |
| 51 } | 52 } |
| 52 | 53 |
| 53 } // namespace client | 54 } // namespace client |
| 54 } // namespace aura | 55 } // namespace aura |
| OLD | NEW |