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 UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ | 5 #ifndef UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ |
6 #define UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ | 6 #define UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "ui/ozone/ozone_export.h" | 11 #include "ui/ozone/ozone_export.h" |
12 | 12 |
13 namespace gfx { | 13 namespace gfx { |
14 class Rect; | 14 class Rect; |
15 } | 15 } |
16 | 16 |
17 namespace IPC { | 17 namespace IPC { |
18 class MessageFilter; | 18 class MessageFilter; |
19 } | 19 } |
20 | 20 |
21 namespace shell { | 21 namespace service_manager { |
22 class Connector; | 22 class Connector; |
23 class InterfaceRegistry; | 23 class InterfaceRegistry; |
24 } | 24 } |
25 | 25 |
26 namespace ui { | 26 namespace ui { |
27 | 27 |
28 class CursorFactoryOzone; | 28 class CursorFactoryOzone; |
29 class InputController; | 29 class InputController; |
30 class GpuPlatformSupportHost; | 30 class GpuPlatformSupportHost; |
31 class NativeDisplayDelegate; | 31 class NativeDisplayDelegate; |
(...skipping 21 matching lines...) Expand all Loading... |
53 public: | 53 public: |
54 OzonePlatform(); | 54 OzonePlatform(); |
55 virtual ~OzonePlatform(); | 55 virtual ~OzonePlatform(); |
56 | 56 |
57 // Additional initialization params for the platform. Platforms must not | 57 // Additional initialization params for the platform. Platforms must not |
58 // retain a reference to this structure. | 58 // retain a reference to this structure. |
59 struct InitParams { | 59 struct InitParams { |
60 // Ozone may retain this pointer for later use. An Ozone platform embedder | 60 // Ozone may retain this pointer for later use. An Ozone platform embedder |
61 // must set this parameter in order for the Ozone platform implementation to | 61 // must set this parameter in order for the Ozone platform implementation to |
62 // be able to use Mojo. | 62 // be able to use Mojo. |
63 shell::Connector* connector = nullptr; | 63 service_manager::Connector* connector = nullptr; |
64 | 64 |
65 // Setting this to true indicates that the platform implementation should | 65 // Setting this to true indicates that the platform implementation should |
66 // operate as a single process for platforms (i.e. drm) that are usually | 66 // operate as a single process for platforms (i.e. drm) that are usually |
67 // split between a main and gpu specific portion. | 67 // split between a main and gpu specific portion. |
68 bool single_process = false; | 68 bool single_process = false; |
69 }; | 69 }; |
70 | 70 |
71 // Initializes the subsystems/resources necessary for the UI process (e.g. | 71 // Initializes the subsystems/resources necessary for the UI process (e.g. |
72 // events, etc.) | 72 // events, etc.) |
73 // TODO(rjkroege): Remove deprecated entry point (http://crbug.com/620934) | 73 // TODO(rjkroege): Remove deprecated entry point (http://crbug.com/620934) |
(...skipping 27 matching lines...) Expand all Loading... |
101 virtual std::unique_ptr<SystemInputInjector> CreateSystemInputInjector() = 0; | 101 virtual std::unique_ptr<SystemInputInjector> CreateSystemInputInjector() = 0; |
102 virtual std::unique_ptr<PlatformWindow> CreatePlatformWindow( | 102 virtual std::unique_ptr<PlatformWindow> CreatePlatformWindow( |
103 PlatformWindowDelegate* delegate, | 103 PlatformWindowDelegate* delegate, |
104 const gfx::Rect& bounds) = 0; | 104 const gfx::Rect& bounds) = 0; |
105 virtual std::unique_ptr<ui::NativeDisplayDelegate> | 105 virtual std::unique_ptr<ui::NativeDisplayDelegate> |
106 CreateNativeDisplayDelegate() = 0; | 106 CreateNativeDisplayDelegate() = 0; |
107 | 107 |
108 // Ozone platform implementations may also choose to expose mojo interfaces to | 108 // Ozone platform implementations may also choose to expose mojo interfaces to |
109 // internal functionality. Embedders wishing to take advantage of ozone mojo | 109 // internal functionality. Embedders wishing to take advantage of ozone mojo |
110 // implementations must invoke AddInterfaces with a valid | 110 // implementations must invoke AddInterfaces with a valid |
111 // shell::InterfaceRegistry* pointer to export all Mojo interfaces defined | 111 // service_manager::InterfaceRegistry* pointer to export all Mojo interfaces |
112 // within Ozone. | 112 // defined within Ozone. |
113 // | 113 // |
114 // A default do-nothing implementation is provided to permit platform | 114 // A default do-nothing implementation is provided to permit platform |
115 // implementations to opt out of implementing any Mojo interfaces. | 115 // implementations to opt out of implementing any Mojo interfaces. |
116 virtual void AddInterfaces(shell::InterfaceRegistry* registry); | 116 virtual void AddInterfaces(service_manager::InterfaceRegistry* registry); |
117 | 117 |
118 private: | 118 private: |
119 virtual void InitializeUI() = 0; | 119 virtual void InitializeUI() = 0; |
120 virtual void InitializeGPU() = 0; | 120 virtual void InitializeGPU() = 0; |
121 virtual void InitializeUI(const InitParams& args); | 121 virtual void InitializeUI(const InitParams& args); |
122 virtual void InitializeGPU(const InitParams& args); | 122 virtual void InitializeGPU(const InitParams& args); |
123 | 123 |
124 static void CreateInstance(); | 124 static void CreateInstance(); |
125 | 125 |
126 static OzonePlatform* instance_; | 126 static OzonePlatform* instance_; |
127 | 127 |
128 DISALLOW_COPY_AND_ASSIGN(OzonePlatform); | 128 DISALLOW_COPY_AND_ASSIGN(OzonePlatform); |
129 }; | 129 }; |
130 | 130 |
131 } // namespace ui | 131 } // namespace ui |
132 | 132 |
133 #endif // UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ | 133 #endif // UI_OZONE_PUBLIC_OZONE_PLATFORM_H_ |
OLD | NEW |