| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/ozone/platform/caca/ozone_platform_caca.h" | 5 #include "ui/ozone/platform/caca/ozone_platform_caca.h" |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" |
| 8 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" | 9 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" |
| 9 #include "ui/events/ozone/layout/no/no_keyboard_layout_engine.h" | 10 #include "ui/events/ozone/layout/no/no_keyboard_layout_engine.h" |
| 10 #include "ui/ozone/common/native_display_delegate_ozone.h" | 11 #include "ui/ozone/common/native_display_delegate_ozone.h" |
| 11 #include "ui/ozone/common/stub_overlay_manager.h" | 12 #include "ui/ozone/common/stub_overlay_manager.h" |
| 12 #include "ui/ozone/platform/caca/caca_event_source.h" | 13 #include "ui/ozone/platform/caca/caca_event_source.h" |
| 13 #include "ui/ozone/platform/caca/caca_window.h" | 14 #include "ui/ozone/platform/caca/caca_window.h" |
| 14 #include "ui/ozone/platform/caca/caca_window_manager.h" | 15 #include "ui/ozone/platform/caca/caca_window_manager.h" |
| 15 #include "ui/ozone/public/cursor_factory_ozone.h" | 16 #include "ui/ozone/public/cursor_factory_ozone.h" |
| 16 #include "ui/ozone/public/gpu_platform_support.h" | 17 #include "ui/ozone/public/gpu_platform_support.h" |
| 17 #include "ui/ozone/public/gpu_platform_support_host.h" | 18 #include "ui/ozone/public/gpu_platform_support_host.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 40 } | 41 } |
| 41 InputController* GetInputController() override { | 42 InputController* GetInputController() override { |
| 42 return input_controller_.get(); | 43 return input_controller_.get(); |
| 43 } | 44 } |
| 44 GpuPlatformSupport* GetGpuPlatformSupport() override { | 45 GpuPlatformSupport* GetGpuPlatformSupport() override { |
| 45 return gpu_platform_support_.get(); | 46 return gpu_platform_support_.get(); |
| 46 } | 47 } |
| 47 GpuPlatformSupportHost* GetGpuPlatformSupportHost() override { | 48 GpuPlatformSupportHost* GetGpuPlatformSupportHost() override { |
| 48 return gpu_platform_support_host_.get(); | 49 return gpu_platform_support_host_.get(); |
| 49 } | 50 } |
| 50 scoped_ptr<SystemInputInjector> CreateSystemInputInjector() override { | 51 std::unique_ptr<SystemInputInjector> CreateSystemInputInjector() override { |
| 51 return nullptr; // no input injection support. | 52 return nullptr; // no input injection support. |
| 52 } | 53 } |
| 53 scoped_ptr<PlatformWindow> CreatePlatformWindow( | 54 std::unique_ptr<PlatformWindow> CreatePlatformWindow( |
| 54 PlatformWindowDelegate* delegate, | 55 PlatformWindowDelegate* delegate, |
| 55 const gfx::Rect& bounds) override { | 56 const gfx::Rect& bounds) override { |
| 56 scoped_ptr<CacaWindow> caca_window(new CacaWindow( | 57 std::unique_ptr<CacaWindow> caca_window(new CacaWindow( |
| 57 delegate, window_manager_.get(), event_source_.get(), bounds)); | 58 delegate, window_manager_.get(), event_source_.get(), bounds)); |
| 58 if (!caca_window->Initialize()) | 59 if (!caca_window->Initialize()) |
| 59 return nullptr; | 60 return nullptr; |
| 60 return std::move(caca_window); | 61 return std::move(caca_window); |
| 61 } | 62 } |
| 62 scoped_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() override { | 63 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
| 63 return make_scoped_ptr(new NativeDisplayDelegateOzone()); | 64 override { |
| 65 return base::WrapUnique(new NativeDisplayDelegateOzone()); |
| 64 } | 66 } |
| 65 | 67 |
| 66 void InitializeUI() override { | 68 void InitializeUI() override { |
| 67 window_manager_.reset(new CacaWindowManager); | 69 window_manager_.reset(new CacaWindowManager); |
| 68 overlay_manager_.reset(new StubOverlayManager()); | 70 overlay_manager_.reset(new StubOverlayManager()); |
| 69 event_source_.reset(new CacaEventSource()); | 71 event_source_.reset(new CacaEventSource()); |
| 70 cursor_factory_ozone_.reset(new CursorFactoryOzone()); | 72 cursor_factory_ozone_.reset(new CursorFactoryOzone()); |
| 71 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); | 73 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); |
| 72 input_controller_ = CreateStubInputController(); | 74 input_controller_ = CreateStubInputController(); |
| 73 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( | 75 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( |
| 74 make_scoped_ptr(new NoKeyboardLayoutEngine())); | 76 base::WrapUnique(new NoKeyboardLayoutEngine())); |
| 75 } | 77 } |
| 76 | 78 |
| 77 void InitializeGPU() override { | 79 void InitializeGPU() override { |
| 78 gpu_platform_support_.reset(CreateStubGpuPlatformSupport()); | 80 gpu_platform_support_.reset(CreateStubGpuPlatformSupport()); |
| 79 } | 81 } |
| 80 | 82 |
| 81 private: | 83 private: |
| 82 scoped_ptr<CacaWindowManager> window_manager_; | 84 std::unique_ptr<CacaWindowManager> window_manager_; |
| 83 scoped_ptr<CacaEventSource> event_source_; | 85 std::unique_ptr<CacaEventSource> event_source_; |
| 84 scoped_ptr<CursorFactoryOzone> cursor_factory_ozone_; | 86 std::unique_ptr<CursorFactoryOzone> cursor_factory_ozone_; |
| 85 scoped_ptr<GpuPlatformSupport> gpu_platform_support_; | 87 std::unique_ptr<GpuPlatformSupport> gpu_platform_support_; |
| 86 scoped_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; | 88 std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; |
| 87 scoped_ptr<InputController> input_controller_; | 89 std::unique_ptr<InputController> input_controller_; |
| 88 scoped_ptr<OverlayManagerOzone> overlay_manager_; | 90 std::unique_ptr<OverlayManagerOzone> overlay_manager_; |
| 89 | 91 |
| 90 DISALLOW_COPY_AND_ASSIGN(OzonePlatformCaca); | 92 DISALLOW_COPY_AND_ASSIGN(OzonePlatformCaca); |
| 91 }; | 93 }; |
| 92 | 94 |
| 93 } // namespace | 95 } // namespace |
| 94 | 96 |
| 95 OzonePlatform* CreateOzonePlatformCaca() { | 97 OzonePlatform* CreateOzonePlatformCaca() { |
| 96 return new OzonePlatformCaca; | 98 return new OzonePlatformCaca; |
| 97 } | 99 } |
| 98 | 100 |
| 99 } // namespace ui | 101 } // namespace ui |
| OLD | NEW |