Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(426)

Side by Side Diff: ash/mus/window_manager_application.cc

Issue 2182643003: Remove shell::Connection* parameter to InterfaceFactory<T>::Create() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ash/mus/window_manager_application.h ('k') | ash/sysui/sysui_application.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ash/mus/window_manager_application.h" 5 #include "ash/mus/window_manager_application.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/material_design/material_design_controller.h" 9 #include "ash/common/material_design/material_design_controller.h"
10 #include "ash/mus/accelerators/accelerator_registrar_impl.h" 10 #include "ash/mus/accelerators/accelerator_registrar_impl.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 connection->AddInterface<::ui::mojom::AcceleratorRegistrar>(this); 120 connection->AddInterface<::ui::mojom::AcceleratorRegistrar>(this);
121 if (connection->GetRemoteIdentity().name() == "mojo:mash_session") { 121 if (connection->GetRemoteIdentity().name() == "mojo:mash_session") {
122 connection->GetInterface(&session_); 122 connection->GetInterface(&session_);
123 session_->AddScreenlockStateListener( 123 session_->AddScreenlockStateListener(
124 screenlock_state_listener_binding_.CreateInterfacePtrAndBind()); 124 screenlock_state_listener_binding_.CreateInterfacePtrAndBind());
125 } 125 }
126 return true; 126 return true;
127 } 127 }
128 128
129 void WindowManagerApplication::Create( 129 void WindowManagerApplication::Create(
130 shell::Connection* connection, 130 const shell::Identity& remote_identity,
131 mojo::InterfaceRequest<mojom::ShelfLayout> request) { 131 mojo::InterfaceRequest<mojom::ShelfLayout> request) {
132 // TODO(msw): Handle multiple shelves (one per display). 132 // TODO(msw): Handle multiple shelves (one per display).
133 if (!window_manager_->GetRootWindowControllers().empty()) { 133 if (!window_manager_->GetRootWindowControllers().empty()) {
134 shelf_layout_bindings_.AddBinding(shelf_layout_.get(), std::move(request)); 134 shelf_layout_bindings_.AddBinding(shelf_layout_.get(), std::move(request));
135 } else { 135 } else {
136 shelf_layout_requests_.push_back(std::move(request)); 136 shelf_layout_requests_.push_back(std::move(request));
137 } 137 }
138 } 138 }
139 139
140 void WindowManagerApplication::Create( 140 void WindowManagerApplication::Create(
141 shell::Connection* connection, 141 const shell::Identity& remote_identity,
142 mojo::InterfaceRequest<mojom::UserWindowController> request) { 142 mojo::InterfaceRequest<mojom::UserWindowController> request) {
143 if (!window_manager_->GetRootWindowControllers().empty()) { 143 if (!window_manager_->GetRootWindowControllers().empty()) {
144 user_window_controller_bindings_.AddBinding(user_window_controller_.get(), 144 user_window_controller_bindings_.AddBinding(user_window_controller_.get(),
145 std::move(request)); 145 std::move(request));
146 } else { 146 } else {
147 user_window_controller_requests_.push_back(std::move(request)); 147 user_window_controller_requests_.push_back(std::move(request));
148 } 148 }
149 } 149 }
150 150
151 void WindowManagerApplication::Create( 151 void WindowManagerApplication::Create(
152 shell::Connection* connection, 152 const shell::Identity& remote_identity,
153 mojo::InterfaceRequest<::ui::mojom::AcceleratorRegistrar> request) { 153 mojo::InterfaceRequest<::ui::mojom::AcceleratorRegistrar> request) {
154 if (!window_manager_->window_manager_client()) 154 if (!window_manager_->window_manager_client())
155 return; // Can happen during shutdown. 155 return; // Can happen during shutdown.
156 156
157 uint16_t accelerator_namespace_id; 157 uint16_t accelerator_namespace_id;
158 if (!window_manager_->GetNextAcceleratorNamespaceId( 158 if (!window_manager_->GetNextAcceleratorNamespaceId(
159 &accelerator_namespace_id)) { 159 &accelerator_namespace_id)) {
160 DVLOG(1) << "Max number of accelerators registered, ignoring request."; 160 DVLOG(1) << "Max number of accelerators registered, ignoring request.";
161 // All ids are used. Normally shouldn't happen, so we close the connection. 161 // All ids are used. Normally shouldn't happen, so we close the connection.
162 return; 162 return;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 RootWindowController* controller) { 201 RootWindowController* controller) {
202 // TODO(msw): this isn't right, ownership should belong in WindowManager 202 // TODO(msw): this isn't right, ownership should belong in WindowManager
203 // and/or RootWindowController. But this is temporary until we get rid of 203 // and/or RootWindowController. But this is temporary until we get rid of
204 // sysui. 204 // sysui.
205 shelf_layout_.reset(); 205 shelf_layout_.reset();
206 user_window_controller_.reset(); 206 user_window_controller_.reset();
207 } 207 }
208 208
209 } // namespace mus 209 } // namespace mus
210 } // namespace ash 210 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/window_manager_application.h ('k') | ash/sysui/sysui_application.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698