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

Side by Side Diff: ui/ozone/ozone_platform.h

Issue 379233005: ozone: Move public files to ui/ozone/public & update public DEPS (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « ui/ozone/ozone.gyp ('k') | ui/ozone/ozone_platform.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2013 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 #ifndef UI_OZONE_OZONE_PLATFORM_H_
6 #define UI_OZONE_OZONE_PLATFORM_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/ozone/ozone_export.h"
10
11 namespace ui {
12
13 class CursorFactoryOzone;
14 class EventFactoryOzone;
15 class NativeDisplayDelegate;
16 class SurfaceFactoryOzone;
17 class TouchscreenDeviceManager;
18 class GpuPlatformSupport;
19 class GpuPlatformSupportHost;
20
21 // Base class for Ozone platform implementations.
22 //
23 // Ozone platforms must override this class and implement the virtual
24 // GetFooFactoryOzone() methods to provide implementations of the
25 // various ozone interfaces.
26 //
27 // The OzonePlatform subclass can own any state needed by the
28 // implementation that is shared between the various ozone interfaces,
29 // such as a connection to the windowing system.
30 //
31 // A platform is free to use different implementations of each
32 // interface depending on the context. You can, for example, create
33 // different objects depending on the underlying hardware, command
34 // line flags, or whatever is appropriate for the platform.
35 class OZONE_EXPORT OzonePlatform {
36 public:
37 OzonePlatform();
38 virtual ~OzonePlatform();
39
40 // Initializes the subsystems/resources necessary for the UI process (e.g.
41 // events, surface, etc.)
42 static void InitializeForUI();
43
44 // Initializes the subsystems/resources necessary for the GPU process.
45 static void InitializeForGPU();
46
47 static OzonePlatform* GetInstance();
48
49 // Factory getters to override in subclasses. The returned objects will be
50 // injected into the appropriate layer at startup. Subclasses should not
51 // inject these objects themselves. Ownership is retained by OzonePlatform.
52 virtual ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() = 0;
53 virtual ui::EventFactoryOzone* GetEventFactoryOzone() = 0;
54 virtual ui::CursorFactoryOzone* GetCursorFactoryOzone() = 0;
55 virtual ui::GpuPlatformSupport* GetGpuPlatformSupport() = 0;
56 virtual ui::GpuPlatformSupportHost* GetGpuPlatformSupportHost() = 0;
57 #if defined(OS_CHROMEOS)
58 virtual scoped_ptr<ui::NativeDisplayDelegate>
59 CreateNativeDisplayDelegate() = 0;
60 virtual scoped_ptr<ui::TouchscreenDeviceManager>
61 CreateTouchscreenDeviceManager() = 0;
62 #endif
63
64 private:
65 virtual void InitializeUI() = 0;
66 virtual void InitializeGPU() = 0;
67
68 static void CreateInstance();
69
70 static OzonePlatform* instance_;
71
72 DISALLOW_COPY_AND_ASSIGN(OzonePlatform);
73 };
74
75 } // namespace ui
76
77 #endif // UI_OZONE_OZONE_PLATFORM_H_
OLDNEW
« no previous file with comments | « ui/ozone/ozone.gyp ('k') | ui/ozone/ozone_platform.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698