Chromium Code Reviews| 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 #include "chromecast/ozone/ozone_platform_chromecast.h" | |
|
lcwu1
2015/03/27 00:51:42
Add a vertical space between the header comment an
halliwell
2015/03/27 01:45:02
Done.
| |
| 5 | |
| 6 #include "chromecast/ozone/chromecast_egl_platform.h" | |
| 7 #include "chromecast/ozone/gpu_platform_support_chromecast.h" | |
| 8 #include "chromecast/ozone/platform_window_chromecast.h" | |
| 9 #include "chromecast/ozone/surface_factory_chromecast.h" | |
| 10 #include "ui/ozone/common/native_display_delegate_ozone.h" | |
| 11 #include "ui/ozone/public/cursor_factory_ozone.h" | |
| 12 #include "ui/ozone/public/gpu_platform_support_host.h" | |
| 13 #include "ui/ozone/public/input_controller.h" | |
| 14 #include "ui/ozone/public/system_input_injector.h" | |
| 15 | |
| 16 namespace chromecast { | |
| 17 namespace ozone { | |
| 18 | |
| 19 OzonePlatformChromecast::OzonePlatformChromecast( | |
| 20 scoped_ptr<ChromecastEglPlatform> egl_platform) | |
| 21 : egl_platform_(egl_platform.Pass()) { | |
| 22 } | |
| 23 | |
| 24 OzonePlatformChromecast::~OzonePlatformChromecast() { | |
| 25 } | |
| 26 | |
| 27 ui::SurfaceFactoryOzone* OzonePlatformChromecast::GetSurfaceFactoryOzone() { | |
| 28 return surface_factory_ozone_.get(); | |
| 29 } | |
| 30 | |
| 31 ui::CursorFactoryOzone* OzonePlatformChromecast::GetCursorFactoryOzone() { | |
| 32 return cursor_factory_ozone_.get(); | |
| 33 } | |
| 34 | |
| 35 ui::InputController* OzonePlatformChromecast::GetInputController() { | |
| 36 return input_controller_.get(); | |
| 37 } | |
| 38 | |
| 39 ui::GpuPlatformSupport* OzonePlatformChromecast::GetGpuPlatformSupport() { | |
| 40 return gpu_platform_support_.get(); | |
| 41 } | |
| 42 | |
| 43 ui::GpuPlatformSupportHost* | |
| 44 OzonePlatformChromecast::GetGpuPlatformSupportHost() { | |
| 45 return gpu_platform_support_host_.get(); | |
| 46 } | |
| 47 | |
| 48 scoped_ptr<ui::SystemInputInjector> | |
| 49 OzonePlatformChromecast::CreateSystemInputInjector() { | |
| 50 return scoped_ptr<ui::SystemInputInjector>(); // no input injection support | |
| 51 } | |
| 52 | |
| 53 scoped_ptr<ui::PlatformWindow> OzonePlatformChromecast::CreatePlatformWindow( | |
| 54 ui::PlatformWindowDelegate* delegate, | |
| 55 const gfx::Rect& bounds) { | |
| 56 return make_scoped_ptr<ui::PlatformWindow>( | |
| 57 new PlatformWindowChromecast(delegate, bounds)); | |
| 58 } | |
| 59 | |
| 60 scoped_ptr<ui::NativeDisplayDelegate> | |
| 61 OzonePlatformChromecast::CreateNativeDisplayDelegate() { | |
| 62 return scoped_ptr<ui::NativeDisplayDelegate>( | |
| 63 new ui::NativeDisplayDelegateOzone()); | |
| 64 } | |
| 65 | |
| 66 void OzonePlatformChromecast::InitializeUI() { | |
| 67 if (!surface_factory_ozone_) { | |
| 68 surface_factory_ozone_.reset( | |
| 69 new SurfaceFactoryChromecast(egl_platform_.Pass())); | |
| 70 } | |
| 71 cursor_factory_ozone_.reset(new ui::CursorFactoryOzone()); | |
| 72 input_controller_ = ui::CreateStubInputController(); | |
| 73 gpu_platform_support_host_.reset(ui::CreateStubGpuPlatformSupportHost()); | |
| 74 } | |
| 75 | |
| 76 void OzonePlatformChromecast::InitializeGPU() { | |
| 77 if (!surface_factory_ozone_) { | |
| 78 surface_factory_ozone_.reset( | |
| 79 new SurfaceFactoryChromecast(egl_platform_.Pass())); | |
| 80 } | |
| 81 gpu_platform_support_.reset( | |
| 82 new GpuPlatformSupportChromecast(surface_factory_ozone_.get())); | |
| 83 } | |
| 84 | |
| 85 } // namespace ozone | |
| 86 } // namespace chromecast | |
| OLD | NEW |