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

Side by Side Diff: components/mus/public/cpp/lib/window_tree_host_factory.cc

Issue 1674903003: Extract shell methods from ApplicationImpl into a base class, and pass this to Initialize() instead. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mojom
Patch Set: . Created 4 years, 10 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 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 "components/mus/public/cpp/window_tree_host_factory.h" 5 #include "components/mus/public/cpp/window_tree_host_factory.h"
6 6
7 #include "components/mus/public/cpp/window_tree_connection.h" 7 #include "components/mus/public/cpp/window_tree_connection.h"
8 #include "components/mus/public/cpp/window_tree_delegate.h" 8 #include "components/mus/public/cpp/window_tree_delegate.h"
9 #include "mojo/shell/public/cpp/application_impl.h" 9 #include "mojo/shell/public/cpp/shell.h"
10 10
11 namespace mus { 11 namespace mus {
12 12
13 void CreateWindowTreeHost(mojom::WindowTreeHostFactory* factory, 13 void CreateWindowTreeHost(mojom::WindowTreeHostFactory* factory,
14 WindowTreeDelegate* delegate, 14 WindowTreeDelegate* delegate,
15 mojom::WindowTreeHostPtr* host, 15 mojom::WindowTreeHostPtr* host,
16 WindowManagerDelegate* window_manager_delegate) { 16 WindowManagerDelegate* window_manager_delegate) {
17 mojom::WindowTreeClientPtr tree_client; 17 mojom::WindowTreeClientPtr tree_client;
18 WindowTreeConnection::CreateForWindowManager( 18 WindowTreeConnection::CreateForWindowManager(
19 delegate, GetProxy(&tree_client), 19 delegate, GetProxy(&tree_client),
20 WindowTreeConnection::CreateType::DONT_WAIT_FOR_EMBED, 20 WindowTreeConnection::CreateType::DONT_WAIT_FOR_EMBED,
21 window_manager_delegate); 21 window_manager_delegate);
22 factory->CreateWindowTreeHost(GetProxy(host), std::move(tree_client)); 22 factory->CreateWindowTreeHost(GetProxy(host), std::move(tree_client));
23 } 23 }
24 24
25 void CreateWindowTreeHost(mojo::ApplicationImpl* app, 25 void CreateWindowTreeHost(mojo::Shell* shell,
26 WindowTreeDelegate* delegate, 26 WindowTreeDelegate* delegate,
27 mojom::WindowTreeHostPtr* host, 27 mojom::WindowTreeHostPtr* host,
28 WindowManagerDelegate* window_manager_delegate) { 28 WindowManagerDelegate* window_manager_delegate) {
29 mojom::WindowTreeHostFactoryPtr factory; 29 mojom::WindowTreeHostFactoryPtr factory;
30 app->ConnectToService("mojo:mus", &factory); 30 shell->ConnectToService("mojo:mus", &factory);
31 CreateWindowTreeHost(factory.get(), delegate, host, window_manager_delegate); 31 CreateWindowTreeHost(factory.get(), delegate, host, window_manager_delegate);
32 } 32 }
33 33
34 } // namespace mus 34 } // namespace mus
OLDNEW
« no previous file with comments | « components/mus/public/cpp/lib/window_tree_client_impl.cc ('k') | components/mus/public/cpp/tests/window_server_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698