OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_MUS_MUS_APP_H_ | 5 #ifndef COMPONENTS_MUS_MUS_APP_H_ |
6 #define COMPONENTS_MUS_MUS_APP_H_ | 6 #define COMPONENTS_MUS_MUS_APP_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/weak_ptr.h" | 15 #include "base/memory/weak_ptr.h" |
| 16 #include "components/mus/public/interfaces/clipboard.mojom.h" |
16 #include "components/mus/public/interfaces/display.mojom.h" | 17 #include "components/mus/public/interfaces/display.mojom.h" |
17 #include "components/mus/public/interfaces/gpu.mojom.h" | 18 #include "components/mus/public/interfaces/gpu.mojom.h" |
18 #include "components/mus/public/interfaces/user_access_manager.mojom.h" | 19 #include "components/mus/public/interfaces/user_access_manager.mojom.h" |
19 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" | 20 #include "components/mus/public/interfaces/window_manager_factory.mojom.h" |
20 #include "components/mus/public/interfaces/window_server_test.mojom.h" | 21 #include "components/mus/public/interfaces/window_server_test.mojom.h" |
21 #include "components/mus/public/interfaces/window_tree.mojom.h" | 22 #include "components/mus/public/interfaces/window_tree.mojom.h" |
22 #include "components/mus/public/interfaces/window_tree_host.mojom.h" | 23 #include "components/mus/public/interfaces/window_tree_host.mojom.h" |
23 #include "components/mus/ws/platform_display_init_params.h" | 24 #include "components/mus/ws/platform_display_init_params.h" |
24 #include "components/mus/ws/user_id.h" | 25 #include "components/mus/ws/user_id.h" |
25 #include "components/mus/ws/window_server_delegate.h" | 26 #include "components/mus/ws/window_server_delegate.h" |
(...skipping 21 matching lines...) Expand all Loading... |
47 namespace mus { | 48 namespace mus { |
48 namespace ws { | 49 namespace ws { |
49 class ForwardingWindowManager; | 50 class ForwardingWindowManager; |
50 class PlatformScreen; | 51 class PlatformScreen; |
51 class WindowServer; | 52 class WindowServer; |
52 } | 53 } |
53 | 54 |
54 class MusApp | 55 class MusApp |
55 : public shell::ShellClient, | 56 : public shell::ShellClient, |
56 public ws::WindowServerDelegate, | 57 public ws::WindowServerDelegate, |
| 58 public shell::InterfaceFactory<mojom::Clipboard>, |
57 public shell::InterfaceFactory<mojom::DisplayManager>, | 59 public shell::InterfaceFactory<mojom::DisplayManager>, |
| 60 public shell::InterfaceFactory<mojom::Gpu>, |
58 public shell::InterfaceFactory<mojom::UserAccessManager>, | 61 public shell::InterfaceFactory<mojom::UserAccessManager>, |
59 public shell::InterfaceFactory<mojom::WindowManagerFactoryService>, | 62 public shell::InterfaceFactory<mojom::WindowManagerFactoryService>, |
60 public shell::InterfaceFactory<mojom::WindowTreeFactory>, | 63 public shell::InterfaceFactory<mojom::WindowTreeFactory>, |
61 public shell::InterfaceFactory<mojom::WindowTreeHostFactory>, | 64 public shell::InterfaceFactory<mojom::WindowTreeHostFactory>, |
62 public shell::InterfaceFactory<mojom::WindowServerTest>, | 65 public shell::InterfaceFactory<mojom::WindowServerTest> { |
63 public shell::InterfaceFactory<mojom::Gpu> { | |
64 public: | 66 public: |
65 MusApp(); | 67 MusApp(); |
66 ~MusApp() override; | 68 ~MusApp() override; |
67 | 69 |
68 private: | 70 private: |
69 // Holds InterfaceRequests received before the first WindowTreeHost Display | 71 // Holds InterfaceRequests received before the first WindowTreeHost Display |
70 // has been established. | 72 // has been established. |
71 struct PendingRequest; | 73 struct PendingRequest; |
72 struct UserState; | 74 struct UserState; |
73 | 75 |
(...skipping 14 matching lines...) Expand all Loading... |
88 const shell::Identity& identity, | 90 const shell::Identity& identity, |
89 uint32_t id) override; | 91 uint32_t id) override; |
90 bool AcceptConnection(shell::Connection* connection) override; | 92 bool AcceptConnection(shell::Connection* connection) override; |
91 | 93 |
92 // WindowServerDelegate: | 94 // WindowServerDelegate: |
93 void OnFirstDisplayReady() override; | 95 void OnFirstDisplayReady() override; |
94 void OnNoMoreDisplays() override; | 96 void OnNoMoreDisplays() override; |
95 bool IsTestConfig() const override; | 97 bool IsTestConfig() const override; |
96 void CreateDefaultDisplays() override; | 98 void CreateDefaultDisplays() override; |
97 | 99 |
| 100 // shell::InterfaceFactory<mojom::Clipboard> implementation. |
| 101 void Create(shell::Connection* connection, |
| 102 mojom::ClipboardRequest request) override; |
| 103 |
98 // shell::InterfaceFactory<mojom::DisplayManager> implementation. | 104 // shell::InterfaceFactory<mojom::DisplayManager> implementation. |
99 void Create(shell::Connection* connection, | 105 void Create(shell::Connection* connection, |
100 mojom::DisplayManagerRequest request) override; | 106 mojom::DisplayManagerRequest request) override; |
101 | 107 |
| 108 // shell::InterfaceFactory<mojom::Gpu> implementation. |
| 109 void Create(shell::Connection* connection, |
| 110 mojom::GpuRequest request) override; |
| 111 |
102 // shell::InterfaceFactory<mojom::UserAccessManager> implementation. | 112 // shell::InterfaceFactory<mojom::UserAccessManager> implementation. |
103 void Create(shell::Connection* connection, | 113 void Create(shell::Connection* connection, |
104 mojom::UserAccessManagerRequest request) override; | 114 mojom::UserAccessManagerRequest request) override; |
105 | 115 |
106 // shell::InterfaceFactory<mojom::WindowManagerFactoryService> implementation. | 116 // shell::InterfaceFactory<mojom::WindowManagerFactoryService> implementation. |
107 void Create(shell::Connection* connection, | 117 void Create(shell::Connection* connection, |
108 mojom::WindowManagerFactoryServiceRequest request) override; | 118 mojom::WindowManagerFactoryServiceRequest request) override; |
109 | 119 |
110 // shell::InterfaceFactory<mojom::WindowTreeFactory>: | 120 // shell::InterfaceFactory<mojom::WindowTreeFactory>: |
111 void Create(shell::Connection* connection, | 121 void Create(shell::Connection* connection, |
112 mojom::WindowTreeFactoryRequest request) override; | 122 mojom::WindowTreeFactoryRequest request) override; |
113 | 123 |
114 // shell::InterfaceFactory<mojom::WindowTreeHostFactory>: | 124 // shell::InterfaceFactory<mojom::WindowTreeHostFactory>: |
115 void Create(shell::Connection* connection, | 125 void Create(shell::Connection* connection, |
116 mojom::WindowTreeHostFactoryRequest request) override; | 126 mojom::WindowTreeHostFactoryRequest request) override; |
117 | 127 |
118 // shell::InterfaceFactory<mojom::WindowServerTest> implementation. | 128 // shell::InterfaceFactory<mojom::WindowServerTest> implementation. |
119 void Create(shell::Connection* connection, | 129 void Create(shell::Connection* connection, |
120 mojom::WindowServerTestRequest request) override; | 130 mojom::WindowServerTestRequest request) override; |
121 | 131 |
122 // shell::InterfaceFactory<mojom::Gpu> implementation. | |
123 void Create(shell::Connection* connection, | |
124 mojom::GpuRequest request) override; | |
125 | |
126 // Callback for display configuration. |id| is the identifying token for the | 132 // Callback for display configuration. |id| is the identifying token for the |
127 // configured display that will identify a specific physical display across | 133 // configured display that will identify a specific physical display across |
128 // configuration changes. |bounds| is the bounds of the display in screen | 134 // configuration changes. |bounds| is the bounds of the display in screen |
129 // coordinates. | 135 // coordinates. |
130 void OnCreatedPhysicalDisplay(int64_t id, const gfx::Rect& bounds); | 136 void OnCreatedPhysicalDisplay(int64_t id, const gfx::Rect& bounds); |
131 | 137 |
132 ws::PlatformDisplayInitParams platform_display_init_params_; | 138 ws::PlatformDisplayInitParams platform_display_init_params_; |
133 std::unique_ptr<ws::WindowServer> window_server_; | 139 std::unique_ptr<ws::WindowServer> window_server_; |
134 std::unique_ptr<ui::PlatformEventSource> event_source_; | 140 std::unique_ptr<ui::PlatformEventSource> event_source_; |
135 mojo::TracingImpl tracing_; | 141 mojo::TracingImpl tracing_; |
(...skipping 10 matching lines...) Expand all Loading... |
146 std::unique_ptr<ws::PlatformScreen> platform_screen_; | 152 std::unique_ptr<ws::PlatformScreen> platform_screen_; |
147 | 153 |
148 base::WeakPtrFactory<MusApp> weak_ptr_factory_; | 154 base::WeakPtrFactory<MusApp> weak_ptr_factory_; |
149 | 155 |
150 DISALLOW_COPY_AND_ASSIGN(MusApp); | 156 DISALLOW_COPY_AND_ASSIGN(MusApp); |
151 }; | 157 }; |
152 | 158 |
153 } // namespace mus | 159 } // namespace mus |
154 | 160 |
155 #endif // COMPONENTS_MUS_MUS_APP_H_ | 161 #endif // COMPONENTS_MUS_MUS_APP_H_ |
OLD | NEW |