OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "base/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
10 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "mojo/public/cpp/bindings/binding.h" |
11 #include "services/service_manager/public/c/main.h" | 11 #include "services/service_manager/public/c/main.h" |
12 #include "services/service_manager/public/cpp/connector.h" | 12 #include "services/service_manager/public/cpp/connector.h" |
13 #include "services/service_manager/public/cpp/service.h" | 13 #include "services/service_manager/public/cpp/service.h" |
14 #include "services/service_manager/public/cpp/service_context.h" | 14 #include "services/service_manager/public/cpp/service_context.h" |
15 #include "services/service_manager/public/cpp/service_runner.h" | 15 #include "services/service_manager/public/cpp/service_runner.h" |
| 16 #include "ui/aura/client/aura_constants.h" |
16 #include "ui/aura/client/default_capture_client.h" | 17 #include "ui/aura/client/default_capture_client.h" |
17 #include "ui/aura/env.h" | 18 #include "ui/aura/env.h" |
18 #include "ui/aura/mus/property_converter.h" | 19 #include "ui/aura/mus/property_converter.h" |
19 #include "ui/aura/mus/property_utils.h" | 20 #include "ui/aura/mus/property_utils.h" |
20 #include "ui/aura/mus/window_manager_delegate.h" | 21 #include "ui/aura/mus/window_manager_delegate.h" |
21 #include "ui/aura/mus/window_tree_client.h" | 22 #include "ui/aura/mus/window_tree_client.h" |
22 #include "ui/aura/mus/window_tree_client_delegate.h" | 23 #include "ui/aura/mus/window_tree_client_delegate.h" |
23 #include "ui/aura/mus/window_tree_host_mus.h" | 24 #include "ui/aura/mus/window_tree_host_mus.h" |
24 #include "ui/aura/test/test_focus_client.h" | 25 #include "ui/aura/test/test_focus_client.h" |
25 #include "ui/aura/window.h" | 26 #include "ui/aura/window.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 const std::string& name, | 106 const std::string& name, |
106 std::unique_ptr<std::vector<uint8_t>>* new_data) override { | 107 std::unique_ptr<std::vector<uint8_t>>* new_data) override { |
107 return true; | 108 return true; |
108 } | 109 } |
109 void OnWmSetModalType(aura::Window* window, ui::ModalType type) override {} | 110 void OnWmSetModalType(aura::Window* window, ui::ModalType type) override {} |
110 void OnWmSetCanFocus(aura::Window* window, bool can_focus) override {} | 111 void OnWmSetCanFocus(aura::Window* window, bool can_focus) override {} |
111 aura::Window* OnWmCreateTopLevelWindow( | 112 aura::Window* OnWmCreateTopLevelWindow( |
112 ui::mojom::WindowType window_type, | 113 ui::mojom::WindowType window_type, |
113 std::map<std::string, std::vector<uint8_t>>* properties) override { | 114 std::map<std::string, std::vector<uint8_t>>* properties) override { |
114 aura::Window* window = new aura::Window(nullptr); | 115 aura::Window* window = new aura::Window(nullptr); |
| 116 window->SetProperty(aura::client::kEmbedType, |
| 117 aura::client::WindowEmbedType::TOP_LEVEL_IN_WM); |
115 SetWindowType(window, window_type); | 118 SetWindowType(window, window_type); |
116 window->Init(LAYER_NOT_DRAWN); | 119 window->Init(LAYER_NOT_DRAWN); |
117 window->SetBounds(gfx::Rect(10, 10, 500, 500)); | 120 window->SetBounds(gfx::Rect(10, 10, 500, 500)); |
118 root_->AddChild(window); | 121 root_->AddChild(window); |
119 return window; | 122 return window; |
120 } | 123 } |
121 void OnWmClientJankinessChanged(const std::set<aura::Window*>& client_windows, | 124 void OnWmClientJankinessChanged(const std::set<aura::Window*>& client_windows, |
122 bool janky) override { | 125 bool janky) override { |
123 // Don't care. | 126 // Don't care. |
124 } | 127 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 DISALLOW_COPY_AND_ASSIGN(TestWM); | 198 DISALLOW_COPY_AND_ASSIGN(TestWM); |
196 }; | 199 }; |
197 | 200 |
198 } // namespace test | 201 } // namespace test |
199 } // namespace ui | 202 } // namespace ui |
200 | 203 |
201 MojoResult ServiceMain(MojoHandle service_request_handle) { | 204 MojoResult ServiceMain(MojoHandle service_request_handle) { |
202 service_manager::ServiceRunner runner(new ui::test::TestWM); | 205 service_manager::ServiceRunner runner(new ui::test::TestWM); |
203 return runner.Run(service_request_handle); | 206 return runner.Run(service_request_handle); |
204 } | 207 } |
OLD | NEW |