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/test/aura_test_base.h" | 5 #include "ui/aura/test/aura_test_base.h" |
6 | 6 |
| 7 #include "ui/aura/client/window_tree_client.h" |
| 8 #include "ui/aura/root_window.h" |
7 #include "ui/aura/test/aura_test_helper.h" | 9 #include "ui/aura/test/aura_test_helper.h" |
8 #include "ui/aura/test/test_window_delegate.h" | 10 #include "ui/aura/test/test_window_delegate.h" |
9 #include "ui/aura/window.h" | |
10 #include "ui/base/ime/input_method_initializer.h" | 11 #include "ui/base/ime/input_method_initializer.h" |
11 #include "ui/events/gestures/gesture_configuration.h" | 12 #include "ui/events/gestures/gesture_configuration.h" |
12 | 13 |
13 namespace aura { | 14 namespace aura { |
14 namespace test { | 15 namespace test { |
15 | 16 |
16 AuraTestBase::AuraTestBase() | 17 AuraTestBase::AuraTestBase() |
17 : setup_called_(false), | 18 : setup_called_(false), |
18 teardown_called_(false) { | 19 teardown_called_(false) { |
19 } | 20 } |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 window->SetBounds(gfx::Rect(0, 0, 100, 100)); | 93 window->SetBounds(gfx::Rect(0, 0, 100, 100)); |
93 window->Show(); | 94 window->Show(); |
94 return window; | 95 return window; |
95 } | 96 } |
96 | 97 |
97 Window* AuraTestBase::CreateTransientChild(int id, Window* parent) { | 98 Window* AuraTestBase::CreateTransientChild(int id, Window* parent) { |
98 Window* window = new Window(NULL); | 99 Window* window = new Window(NULL); |
99 window->set_id(id); | 100 window->set_id(id); |
100 window->SetType(aura::client::WINDOW_TYPE_NORMAL); | 101 window->SetType(aura::client::WINDOW_TYPE_NORMAL); |
101 window->Init(ui::LAYER_TEXTURED); | 102 window->Init(ui::LAYER_TEXTURED); |
102 window->SetDefaultParentByRootWindow(root_window(), gfx::Rect()); | 103 aura::client::ParentWindowWithContext(window, root_window(), gfx::Rect()); |
103 parent->AddTransientChild(window); | 104 parent->AddTransientChild(window); |
104 return window; | 105 return window; |
105 } | 106 } |
106 | 107 |
107 void AuraTestBase::SetDefaultParentByPrimaryRootWindow(aura::Window* window) { | |
108 window->SetDefaultParentByRootWindow(root_window(), gfx::Rect()); | |
109 } | |
110 | |
111 void AuraTestBase::RunAllPendingInMessageLoop() { | 108 void AuraTestBase::RunAllPendingInMessageLoop() { |
112 helper_->RunAllPendingInMessageLoop(); | 109 helper_->RunAllPendingInMessageLoop(); |
113 } | 110 } |
114 | 111 |
| 112 void AuraTestBase::ParentWindow(Window* window) { |
| 113 client::ParentWindowWithContext(window, root_window(), gfx::Rect()); |
| 114 } |
| 115 |
115 } // namespace test | 116 } // namespace test |
116 } // namespace aura | 117 } // namespace aura |
OLD | NEW |