Chromium Code Reviews| Index: ui/base/ozone/surface_factory_ozone.cc |
| diff --git a/ui/base/ozone/surface_factory_ozone.cc b/ui/base/ozone/surface_factory_ozone.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..382c1cdbaf639dccd33c4d26b496c4a0f89946bc |
| --- /dev/null |
| +++ b/ui/base/ozone/surface_factory_ozone.cc |
| @@ -0,0 +1,38 @@ |
| +// 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 "ui/base/ozone/surface_factory_ozone.h" |
| + |
| +#include "base/lazy_instance.h" |
| +#include "base/memory/scoped_ptr.h" |
| + |
| +namespace ui { |
| + |
| +// Implementation. |
| +static base::LazyInstance<scoped_ptr<SurfaceFactoryOzone> > impl_ = |
| + LAZY_INSTANCE_INITIALIZER; |
| + |
| +SurfaceFactoryOzone::SurfaceFactoryOzone() { |
| +} |
| + |
| +SurfaceFactoryOzone::~SurfaceFactoryOzone() { |
| +} |
| + |
| +SurfaceFactoryOzone* SurfaceFactoryOzone::GetInstance() { |
| + return impl_.Get().get(); |
| +} |
| + |
| +void SurfaceFactoryOzone::SetInstance(SurfaceFactoryOzone* impl) { |
| + impl_.Get().reset(impl); |
| +} |
| + |
| +const char* SurfaceFactoryOzone::DefaultDisplaySpec() { |
| + char* envvar = getenv("ASH_DISPLAY_SPEC"); |
| + if (envvar) |
| + return envvar; |
| + else |
|
sky
2013/05/23 23:47:20
nit: no else (the style guide actually says no els
|
| + return "720x1280*2"; |
| +} |
| + |
| +} // namespace ui |