OLD | NEW |
(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 #include "base/command_line.h" |
| 6 #include "base/logging.h" |
| 7 #include "ui/ozone/ozone_platform.h" |
| 8 |
| 9 namespace ui { |
| 10 |
| 11 OzonePlatform::OzonePlatform() { |
| 12 } |
| 13 |
| 14 OzonePlatform::~OzonePlatform() { |
| 15 gfx::SurfaceFactoryOzone::SetInstance(NULL); |
| 16 ui::EventFactoryOzone::SetInstance(NULL); |
| 17 } |
| 18 |
| 19 // static |
| 20 void OzonePlatform::Initialize() { |
| 21 if (instance_) |
| 22 return; |
| 23 |
| 24 instance_ = CreateDefaultOzonePlatform(); |
| 25 |
| 26 // Inject ozone interfaces. |
| 27 gfx::SurfaceFactoryOzone::SetInstance(instance_->GetSurfaceFactoryOzone()); |
| 28 ui::EventFactoryOzone::SetInstance(instance_->GetEventFactoryOzone()); |
| 29 } |
| 30 |
| 31 // static |
| 32 OzonePlatform* OzonePlatform::instance_; |
| 33 |
| 34 } // namespace ui |
OLD | NEW |