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

Side by Side Diff: services/ui/ws/window_tree_host_factory.h

Issue 2712203002: c++ / mojo changes for 'external window mode'
Patch Set: addressed sky/fwang feedback (take 5), simpler mus_demo changes / passing unittests Created 3 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 #ifndef SERVICES_UI_WS_WINDOW_TREE_HOST_FACTORY_H_ 5 #ifndef SERVICES_UI_WS_WINDOW_TREE_HOST_FACTORY_H_
6 #define SERVICES_UI_WS_WINDOW_TREE_HOST_FACTORY_H_ 6 #define SERVICES_UI_WS_WINDOW_TREE_HOST_FACTORY_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "mojo/public/cpp/bindings/binding_set.h" 10 #include "mojo/public/cpp/bindings/binding_set.h"
11 #include "services/ui/common/types.h"
11 #include "services/ui/public/interfaces/window_tree_host.mojom.h" 12 #include "services/ui/public/interfaces/window_tree_host.mojom.h"
12 #include "services/ui/ws/platform_display_init_params.h" 13 #include "services/ui/ws/platform_display_init_params.h"
13 #include "services/ui/ws/user_id.h" 14 #include "services/ui/ws/user_id.h"
14 15
15 namespace ui { 16 namespace ui {
16 namespace ws { 17 namespace ws {
17 18
18 class WindowServer; 19 class WindowServer;
20 class WindowTree;
19 21
20 class WindowTreeHostFactory : public mojom::WindowTreeHostFactory { 22 class WindowTreeHostFactory : public mojom::WindowTreeHostFactory {
21 public: 23 public:
22 WindowTreeHostFactory(WindowServer* window_server, const UserId& user_id); 24 WindowTreeHostFactory(WindowServer* window_server, const UserId& user_id);
23 ~WindowTreeHostFactory() override; 25 ~WindowTreeHostFactory() override;
24 26
25 void AddBinding(mojom::WindowTreeHostFactoryRequest request); 27 void AddBinding(mojom::WindowTreeHostFactoryRequest request);
26 28
29 WindowTree* window_tree() { return tree_; }
30 void set_window_tree(WindowTree* tree) { tree_ = tree; }
31
27 private: 32 private:
28 // mojom::WindowTreeHostFactory implementation. 33 // mojom::WindowTreeHostFactory implementation.
29 void CreateWindowTreeHost(mojom::WindowTreeHostRequest host, 34 void CreateWindowTreeHost(mojom::WindowTreeHostRequest host,
30 mojom::WindowTreeClientPtr tree_client) override; 35 mojom::WindowTreeClientPtr tree_client) override;
36 void CreatePlatformWindow(mojom::WindowTreeHostRequest tree_host_request,
37 Id client_id) override;
31 38
32 WindowServer* window_server_; 39 WindowServer* window_server_;
33 const UserId user_id_; 40 const UserId user_id_;
34 PlatformDisplayInitParams platform_display_init_params_; 41 PlatformDisplayInitParams platform_display_init_params_;
35 mojo::BindingSet<mojom::WindowTreeHostFactory> bindings_; 42 mojo::BindingSet<mojom::WindowTreeHostFactory> bindings_;
36 43
44 // Owned by WindowServer.
45 WindowTree* tree_ = nullptr;
46
37 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostFactory); 47 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostFactory);
38 }; 48 };
39 49
40 } // namespace ws 50 } // namespace ws
41 } // namespace ui 51 } // namespace ui
42 52
43 #endif // SERVICES_UI_WS_WINDOW_TREE_HOST_FACTORY_H_ 53 #endif // SERVICES_UI_WS_WINDOW_TREE_HOST_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698