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

Side by Side Diff: components/mus/ws/window_manager_factory_service.cc

Issue 1757403002: More user id tracking for mus: (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweaks Created 4 years, 9 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
OLDNEW
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 "components/mus/ws/window_manager_factory_service.h" 5 #include "components/mus/ws/window_manager_factory_service.h"
6 6
7 #include "components/mus/ws/connection_manager.h" 7 #include "components/mus/ws/connection_manager.h"
8 #include "components/mus/ws/window_tree_impl.h" 8 #include "components/mus/ws/window_tree_impl.h"
9 9
10 namespace mus { 10 namespace mus {
11 namespace ws { 11 namespace ws {
12 12
13 WindowManagerFactoryService::WindowManagerFactoryService( 13 WindowManagerFactoryService::WindowManagerFactoryService(
14 WindowManagerFactoryRegistry* registry, 14 WindowManagerFactoryRegistry* registry,
15 uint32_t user_id, 15 UserId user_id,
16 mojo::InterfaceRequest<mojom::WindowManagerFactoryService> request) 16 mojo::InterfaceRequest<mojom::WindowManagerFactoryService> request)
17 : registry_(registry), 17 : registry_(registry),
18 user_id_(user_id), 18 user_id_(user_id),
19 binding_(this, std::move(request)) {} 19 binding_(this, std::move(request)),
20 window_manager_factory_(nullptr) {}
20 21
21 WindowManagerFactoryService::~WindowManagerFactoryService() {} 22 WindowManagerFactoryService::~WindowManagerFactoryService() {}
22 23
23 void WindowManagerFactoryService::SetWindowManagerFactory( 24 void WindowManagerFactoryService::SetWindowManagerFactory(
24 mojom::WindowManagerFactoryPtr factory) { 25 mojom::WindowManagerFactoryPtr factory) {
25 window_manager_factory_ = std::move(factory); 26 window_manager_factory_ptr_ = std::move(factory);
26 registry_->OnWindowManagerFactorySet();
27 binding_.set_connection_error_handler(base::Bind( 27 binding_.set_connection_error_handler(base::Bind(
28 &WindowManagerFactoryService::OnConnectionLost, base::Unretained(this))); 28 &WindowManagerFactoryService::OnConnectionLost, base::Unretained(this)));
29 SetWindowManagerFactoryImpl(window_manager_factory_ptr_.get());
30 }
31
32 WindowManagerFactoryService::WindowManagerFactoryService(
33 WindowManagerFactoryRegistry* registry,
34 UserId user_id)
35 : registry_(registry),
36 user_id_(user_id),
37 binding_(this),
38 window_manager_factory_(nullptr) {}
39
40 void WindowManagerFactoryService::SetWindowManagerFactoryImpl(
41 mojom::WindowManagerFactory* factory) {
42 DCHECK(!window_manager_factory_);
43 window_manager_factory_ = factory;
44 registry_->OnWindowManagerFactorySet(this);
29 } 45 }
30 46
31 void WindowManagerFactoryService::OnConnectionLost() { 47 void WindowManagerFactoryService::OnConnectionLost() {
32 registry_->OnWindowManagerFactoryConnectionLost(this); 48 registry_->OnWindowManagerFactoryConnectionLost(this);
33 } 49 }
34 50
35 } // namespace ws 51 } // namespace ws
36 } // namespace mus 52 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/ws/window_manager_factory_service.h ('k') | components/mus/ws/window_tree_apptest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698