| 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
|
|
|