OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 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 "content/child/child_native_pixmap_manager_ozone.h" |
| 6 |
| 7 #include "base/file_descriptor_posix.h" |
| 8 #include "base/memory/singleton.h" |
| 9 |
| 10 namespace content { |
| 11 |
| 12 struct ChildNativePixmapManagerTrait |
| 13 : public DefaultSingletonTraits<ChildNativePixmapManager> { |
| 14 static ChildNativePixmapManager* New() { |
| 15 ChildNativePixmapManager* manager = new ChildNativePixmapManager(); |
| 16 manager->Initialize(base::FileDescriptor()); |
| 17 return manager; |
| 18 } |
| 19 }; |
| 20 |
| 21 // static |
| 22 ChildNativePixmapManager* ChildNativePixmapManager::GetInstance() { |
| 23 return Singleton<ChildNativePixmapManager, |
| 24 ChildNativePixmapManagerTrait>::get(); |
| 25 } |
| 26 |
| 27 ChildNativePixmapManager::ChildNativePixmapManager() {} |
| 28 |
| 29 ChildNativePixmapManager::~ChildNativePixmapManager() {} |
| 30 |
| 31 void ChildNativePixmapManager::Initialize( |
| 32 const base::FileDescriptor& device_fd) { |
| 33 pixmap_manager_ = ui::NativePixmapManager::Create(device_fd); |
| 34 } |
| 35 |
| 36 std::vector<ui::NativePixmapManager::Configuration> |
| 37 ChildNativePixmapManager::GetSupportedNativePixmapConfigurations() const { |
| 38 return pixmap_manager_->GetSupportedNativePixmapConfigurations(); |
| 39 } |
| 40 |
| 41 } // namespace content |
OLD | NEW |