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

Unified Diff: ui/ozone/platform/caca/ozone_platform_caca.cc

Issue 291473002: ozone: Initialize a subsystem only if necessary. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tot-merge-r270817 Created 6 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/ozone/ozone_platform.cc ('k') | ui/ozone/platform/dri/ozone_platform_dri.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/caca/ozone_platform_caca.cc
diff --git a/ui/ozone/platform/caca/ozone_platform_caca.cc b/ui/ozone/platform/caca/ozone_platform_caca.cc
index a5a6b02ae2d1a8ecd49b2146b41ade3c972fe39e..a39e23507efe62d41274bf55e3761903f7135eca 100644
--- a/ui/ozone/platform/caca/ozone_platform_caca.cc
+++ b/ui/ozone/platform/caca/ozone_platform_caca.cc
@@ -21,24 +21,22 @@ namespace {
class OzonePlatformCaca : public OzonePlatform {
public:
- OzonePlatformCaca()
- : surface_factory_ozone_(&connection_),
- event_factory_ozone_(&connection_) {}
+ OzonePlatformCaca() {}
virtual ~OzonePlatformCaca() {}
// OzonePlatform:
virtual gfx::SurfaceFactoryOzone* GetSurfaceFactoryOzone() OVERRIDE {
- return &surface_factory_ozone_;
+ return surface_factory_ozone_.get();
}
virtual EventFactoryOzone* GetEventFactoryOzone() OVERRIDE {
- return &event_factory_ozone_;
+ return event_factory_ozone_.get();
}
virtual InputMethodContextFactoryOzone* GetInputMethodContextFactoryOzone()
OVERRIDE {
- return &input_method_context_factory_ozone_;
+ return input_method_context_factory_ozone_.get();
}
virtual CursorFactoryOzone* GetCursorFactoryOzone() OVERRIDE {
- return &cursor_factory_ozone_;
+ return cursor_factory_ozone_.get();
}
#if defined(OS_CHROMEOS)
@@ -48,13 +46,24 @@ class OzonePlatformCaca : public OzonePlatform {
}
#endif
+ virtual void InitializeUI() OVERRIDE {
+ surface_factory_ozone_.reset(new CacaSurfaceFactory(&connection_));
+ event_factory_ozone_.reset(new CacaEventFactory(&connection_));
+ input_method_context_factory_ozone_.reset(
+ new InputMethodContextFactoryOzone());
+ cursor_factory_ozone_.reset(new CursorFactoryOzone());
+ }
+
+ virtual void InitializeGPU() OVERRIDE {}
+
private:
CacaConnection connection_;
- CacaSurfaceFactory surface_factory_ozone_;
- CacaEventFactory event_factory_ozone_;
+ scoped_ptr<CacaSurfaceFactory> surface_factory_ozone_;
+ scoped_ptr<CacaEventFactory> event_factory_ozone_;
// This creates a minimal input context.
- InputMethodContextFactoryOzone input_method_context_factory_ozone_;
- CursorFactoryOzone cursor_factory_ozone_;
+ scoped_ptr<InputMethodContextFactoryOzone>
+ input_method_context_factory_ozone_;
+ scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_;
DISALLOW_COPY_AND_ASSIGN(OzonePlatformCaca);
};
« no previous file with comments | « ui/ozone/ozone_platform.cc ('k') | ui/ozone/platform/dri/ozone_platform_dri.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698