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

Unified Diff: ui/ozone/ozone_platform.cc

Issue 44933002: Implement OzonePlatform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 2 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.h ('k') | ui/ozone/ozone_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/ozone_platform.cc
diff --git a/ui/ozone/ozone_platform.cc b/ui/ozone/ozone_platform.cc
new file mode 100644
index 0000000000000000000000000000000000000000..24a4c8ed28c2200a2cf1a1c28efbf5301858a785
--- /dev/null
+++ b/ui/ozone/ozone_platform.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/command_line.h"
+#include "base/logging.h"
+#include "ui/ozone/ozone_platform.h"
+
+namespace ui {
+
+OzonePlatform::OzonePlatform() {}
+
+OzonePlatform::~OzonePlatform() {
+ gfx::SurfaceFactoryOzone::SetInstance(NULL);
+ ui::EventFactoryOzone::SetInstance(NULL);
+}
+
+// static
+void OzonePlatform::Initialize() {
+ if (instance_)
+ return;
+
+ instance_ = CreateDefaultOzonePlatform();
+
+ // Inject ozone interfaces.
+ gfx::SurfaceFactoryOzone::SetInstance(instance_->GetSurfaceFactoryOzone());
+ ui::EventFactoryOzone::SetInstance(instance_->GetEventFactoryOzone());
+}
+
+// static
+OzonePlatform* OzonePlatform::instance_;
+
+} // namespace ui
« no previous file with comments | « ui/ozone/ozone_platform.h ('k') | ui/ozone/ozone_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698