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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "components/mus/public/cpp/event_matcher.h" | 10 #include "components/mus/public/cpp/event_matcher.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 RootWindowsObserver* observer) { | 97 RootWindowsObserver* observer) { |
98 root_windows_observers_.RemoveObserver(observer); | 98 root_windows_observers_.RemoveObserver(observer); |
99 } | 99 } |
100 | 100 |
101 void WindowManagerApplication::OnAcceleratorRegistrarDestroyed( | 101 void WindowManagerApplication::OnAcceleratorRegistrarDestroyed( |
102 AcceleratorRegistrarImpl* registrar) { | 102 AcceleratorRegistrarImpl* registrar) { |
103 accelerator_registrars_.erase(registrar); | 103 accelerator_registrars_.erase(registrar); |
104 } | 104 } |
105 | 105 |
106 void WindowManagerApplication::Initialize(mojo::Connector* connector, | 106 void WindowManagerApplication::Initialize(mojo::Connector* connector, |
107 const std::string& url, | 107 const mojo::Identity& identity, |
108 const std::string& user_id, | |
109 uint32_t id) { | 108 uint32_t id) { |
110 connector_ = connector; | 109 connector_ = connector; |
111 tracing_.Initialize(connector, url); | 110 tracing_.Initialize(connector, identity.name()); |
112 | 111 |
113 mus::mojom::WindowManagerFactoryServicePtr wm_factory_service; | 112 mus::mojom::WindowManagerFactoryServicePtr wm_factory_service; |
114 connector_->ConnectToInterface("mojo:mus", &wm_factory_service); | 113 connector_->ConnectToInterface("mojo:mus", &wm_factory_service); |
115 wm_factory_service->SetWindowManagerFactory( | 114 wm_factory_service->SetWindowManagerFactory( |
116 window_manager_factory_binding_.CreateInterfacePtrAndBind()); | 115 window_manager_factory_binding_.CreateInterfacePtrAndBind()); |
117 | 116 |
118 user_window_controller_.reset(new UserWindowControllerImpl()); | 117 user_window_controller_.reset(new UserWindowControllerImpl()); |
119 } | 118 } |
120 | 119 |
121 bool WindowManagerApplication::AcceptConnection(mojo::Connection* connection) { | 120 bool WindowManagerApplication::AcceptConnection(mojo::Connection* connection) { |
122 connection->AddInterface<mash::wm::mojom::UserWindowController>(this); | 121 connection->AddInterface<mash::wm::mojom::UserWindowController>(this); |
123 connection->AddInterface<mus::mojom::AcceleratorRegistrar>(this); | 122 connection->AddInterface<mus::mojom::AcceleratorRegistrar>(this); |
124 if (connection->GetRemoteApplicationName() == "mojo:mash_shell") | 123 if (connection->GetRemoteIdentity().name() == "mojo:mash_shell") |
125 connection->GetInterface(&mash_shell_); | 124 connection->GetInterface(&mash_shell_); |
126 return true; | 125 return true; |
127 } | 126 } |
128 | 127 |
129 void WindowManagerApplication::Create( | 128 void WindowManagerApplication::Create( |
130 mojo::Connection* connection, | 129 mojo::Connection* connection, |
131 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> request) { | 130 mojo::InterfaceRequest<mash::wm::mojom::UserWindowController> request) { |
132 if (!root_controllers_.empty() && (*root_controllers_.begin())->root()) { | 131 if (!root_controllers_.empty() && (*root_controllers_.begin())->root()) { |
133 user_window_controller_binding_.AddBinding(user_window_controller_.get(), | 132 user_window_controller_binding_.AddBinding(user_window_controller_.get(), |
134 std::move(request)); | 133 std::move(request)); |
(...skipping 24 matching lines...) Expand all Loading... |
159 | 158 |
160 void WindowManagerApplication::CreateWindowManager( | 159 void WindowManagerApplication::CreateWindowManager( |
161 mus::mojom::DisplayPtr display, | 160 mus::mojom::DisplayPtr display, |
162 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { | 161 mojo::InterfaceRequest<mus::mojom::WindowTreeClient> client_request) { |
163 root_controllers_.insert(RootWindowController::CreateFromDisplay( | 162 root_controllers_.insert(RootWindowController::CreateFromDisplay( |
164 this, std::move(display), std::move(client_request))); | 163 this, std::move(display), std::move(client_request))); |
165 } | 164 } |
166 | 165 |
167 } // namespace wm | 166 } // namespace wm |
168 } // namespace mash | 167 } // namespace mash |
OLD | NEW |