| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mash/wm/window_manager_application.h" | 5 #include "mash/wm/window_manager_application.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 void WindowManagerApplication::Initialize(mojo::ApplicationImpl* app) { | 77 void WindowManagerApplication::Initialize(mojo::ApplicationImpl* app) { |
| 78 app_ = app; | 78 app_ = app; |
| 79 tracing_.Initialize(app); | 79 tracing_.Initialize(app); |
| 80 window_manager_.reset(new WindowManagerImpl()); | 80 window_manager_.reset(new WindowManagerImpl()); |
| 81 // Don't bind to the WindowManager immediately. Wait for OnEmbed() first. | 81 // Don't bind to the WindowManager immediately. Wait for OnEmbed() first. |
| 82 mus::mojom::WindowManagerPtr window_manager; | 82 mus::mojom::WindowManagerPtr window_manager; |
| 83 requests_.push_back( | 83 requests_.push_back( |
| 84 make_scoped_ptr(new mojo::InterfaceRequest<mus::mojom::WindowManager>( | 84 make_scoped_ptr(new mojo::InterfaceRequest<mus::mojom::WindowManager>( |
| 85 mojo::GetProxy(&window_manager)))); | 85 mojo::GetProxy(&window_manager)))); |
| 86 user_window_controller_.reset(new UserWindowControllerImpl()); | 86 user_window_controller_.reset(new UserWindowControllerImpl()); |
| 87 mus::mojom::WindowTreeHostClientPtr host_client; | 87 mus::CreateSingleWindowTreeHost( |
| 88 host_client_binding_.Bind(GetProxy(&host_client)); | 88 app, host_client_binding_.CreateInterfacePtrAndBind(), this, |
| 89 mus::CreateSingleWindowTreeHost(app, std::move(host_client), this, | 89 &window_tree_host_, std::move(window_manager), window_manager_.get()); |
| 90 &window_tree_host_, std::move(window_manager), | |
| 91 window_manager_.get()); | |
| 92 } | 90 } |
| 93 | 91 |
| 94 bool WindowManagerApplication::ConfigureIncomingConnection( | 92 bool WindowManagerApplication::ConfigureIncomingConnection( |
| 95 mojo::ApplicationConnection* connection) { | 93 mojo::ApplicationConnection* connection) { |
| 96 connection->AddService<mash::wm::mojom::UserWindowController>(this); | 94 connection->AddService<mash::wm::mojom::UserWindowController>(this); |
| 97 connection->AddService<mus::mojom::AcceleratorRegistrar>(this); | 95 connection->AddService<mus::mojom::AcceleratorRegistrar>(this); |
| 98 connection->AddService<mus::mojom::WindowManager>(this); | 96 connection->AddService<mus::mojom::WindowManager>(this); |
| 99 return true; | 97 return true; |
| 100 } | 98 } |
| 101 | 99 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 DCHECK_EQ(mus::LoWord(window->id()), container) | 218 DCHECK_EQ(mus::LoWord(window->id()), container) |
| 221 << "Containers must be created before other windows!"; | 219 << "Containers must be created before other windows!"; |
| 222 window->SetBounds(root_->bounds()); | 220 window->SetBounds(root_->bounds()); |
| 223 window->SetVisible(true); | 221 window->SetVisible(true); |
| 224 root_->AddChild(window); | 222 root_->AddChild(window); |
| 225 } | 223 } |
| 226 } | 224 } |
| 227 | 225 |
| 228 } // namespace wm | 226 } // namespace wm |
| 229 } // namespace mash | 227 } // namespace mash |
| OLD | NEW |