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

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

Issue 44933002: Implement OzonePlatform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add external_ozone_platform_files, external_ozone_platform_deps Created 7 years, 1 month 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
(Empty)
1 // Copyright (c) 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_EVENTS_OZONE_OZONE_PLATFORM_H_
6 #define UI_EVENTS_OZONE_OZONE_PLATFORM_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/base/ozone/ozone_export.h"
10 #include "ui/events/ozone/event_factory_ozone.h"
11 #include "ui/gfx/ozone/surface_factory_ozone.h"
12
13 namespace ui {
14
15 // Base class for Ozone platform implementations.
16 //
17 // Ozone platforms must override this class and implement the virtual
18 // GetFooFactoryOzone() methods to provide implementations of the
19 // various ozone interfaces.
20 //
21 // The OzonePlatform subclass can own any state needed by the
22 // implementation that is shared between the various ozone interfaces,
23 // such as a connection to the windowing system.
24 //
25 // A platform is free to use different implementations of each
26 // interface depending on the context. You can, for example, create
27 // different objects depending on the underlying hardware, command
28 // line flags, or whatever is appropriate for the platform.
29 class OZONE_EXPORT OzonePlatform {
30 public:
31 OzonePlatform();
32 virtual ~OzonePlatform();
33
34 // Build an OzonePlatform object. This is usually called by the
35 // content layer to initialize ozone. The caller receives ownership.
36 static OzonePlatform* Create();
37
38 // Factory getters to override in subclasses. The returned objects
39 // will be injected into the appropriate layer at startup.
40 virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() = 0;
41 virtual ui::EventFactoryOzone* GetEventFactoryOzone() = 0;
42
43 private:
44 static OzonePlatform* instance_;
45
46 DISALLOW_COPY_AND_ASSIGN(OzonePlatform);
47 };
48
49 // Hook to be provided by the built-in default implementation.
50 OzonePlatform* CreateDefaultOzonePlatform();
51
52 } // namespace ui
53
54 #endif // UI_OZONE_OZONE_PLATFORM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698