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

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

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

Powered by Google App Engine
This is Rietveld 408576698