| 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.h" |
| 9 #include "ui/aura/window_event_dispatcher.h" | 9 #include "ui/aura/window_event_dispatcher.h" |
| 10 #include "ui/base/class_property.h" | 10 #include "ui/base/class_property.h" |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 } | 39 } |
| 40 | 40 |
| 41 void ParentWindowWithContext(Window* window, | 41 void ParentWindowWithContext(Window* window, |
| 42 Window* context, | 42 Window* context, |
| 43 const gfx::Rect& screen_bounds) { | 43 const gfx::Rect& screen_bounds) { |
| 44 DCHECK(context); | 44 DCHECK(context); |
| 45 | 45 |
| 46 // |context| must be attached to a hierarchy with a WindowParentingClient. | 46 // |context| must be attached to a hierarchy with a WindowParentingClient. |
| 47 WindowParentingClient* client = GetWindowParentingClient(context); | 47 WindowParentingClient* client = GetWindowParentingClient(context); |
| 48 DCHECK(client); | 48 DCHECK(client); |
| 49 Window* default_parent = | 49 Window* default_parent = client->GetDefaultParent(window, screen_bounds); |
| 50 client->GetDefaultParent(context, window, screen_bounds); | |
| 51 default_parent->AddChild(window); | 50 default_parent->AddChild(window); |
| 52 } | 51 } |
| 53 | 52 |
| 54 } // namespace client | 53 } // namespace client |
| 55 } // namespace aura | 54 } // namespace aura |
| OLD | NEW |