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 "base/memory/ptr_util.h" |
9 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" | 9 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" |
10 #include "ui/events/ozone/layout/no/no_keyboard_layout_engine.h" | 10 #include "ui/events/ozone/layout/no/no_keyboard_layout_engine.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 PlatformWindowDelegate* delegate, | 55 PlatformWindowDelegate* delegate, |
56 const gfx::Rect& bounds) override { | 56 const gfx::Rect& bounds) override { |
57 std::unique_ptr<CacaWindow> caca_window(new CacaWindow( | 57 std::unique_ptr<CacaWindow> caca_window(new CacaWindow( |
58 delegate, window_manager_.get(), event_source_.get(), bounds)); | 58 delegate, window_manager_.get(), event_source_.get(), bounds)); |
59 if (!caca_window->Initialize()) | 59 if (!caca_window->Initialize()) |
60 return nullptr; | 60 return nullptr; |
61 return std::move(caca_window); | 61 return std::move(caca_window); |
62 } | 62 } |
63 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() | 63 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
64 override { | 64 override { |
65 return base::WrapUnique(new NativeDisplayDelegateOzone()); | 65 return base::MakeUnique<NativeDisplayDelegateOzone>(); |
66 } | 66 } |
67 | 67 |
68 void InitializeUI() override { | 68 void InitializeUI() override { |
69 window_manager_.reset(new CacaWindowManager); | 69 window_manager_.reset(new CacaWindowManager); |
70 overlay_manager_.reset(new StubOverlayManager()); | 70 overlay_manager_.reset(new StubOverlayManager()); |
71 event_source_.reset(new CacaEventSource()); | 71 event_source_.reset(new CacaEventSource()); |
72 cursor_factory_ozone_.reset(new CursorFactoryOzone()); | 72 cursor_factory_ozone_.reset(new CursorFactoryOzone()); |
73 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); | 73 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); |
74 input_controller_ = CreateStubInputController(); | 74 input_controller_ = CreateStubInputController(); |
75 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( | 75 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( |
76 base::WrapUnique(new NoKeyboardLayoutEngine())); | 76 base::MakeUnique<NoKeyboardLayoutEngine>()); |
77 } | 77 } |
78 | 78 |
79 void InitializeGPU() override { | 79 void InitializeGPU() override { |
80 gpu_platform_support_.reset(CreateStubGpuPlatformSupport()); | 80 gpu_platform_support_.reset(CreateStubGpuPlatformSupport()); |
81 } | 81 } |
82 | 82 |
83 private: | 83 private: |
84 std::unique_ptr<CacaWindowManager> window_manager_; | 84 std::unique_ptr<CacaWindowManager> window_manager_; |
85 std::unique_ptr<CacaEventSource> event_source_; | 85 std::unique_ptr<CacaEventSource> event_source_; |
86 std::unique_ptr<CursorFactoryOzone> cursor_factory_ozone_; | 86 std::unique_ptr<CursorFactoryOzone> cursor_factory_ozone_; |
87 std::unique_ptr<GpuPlatformSupport> gpu_platform_support_; | 87 std::unique_ptr<GpuPlatformSupport> gpu_platform_support_; |
88 std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; | 88 std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; |
89 std::unique_ptr<InputController> input_controller_; | 89 std::unique_ptr<InputController> input_controller_; |
90 std::unique_ptr<OverlayManagerOzone> overlay_manager_; | 90 std::unique_ptr<OverlayManagerOzone> overlay_manager_; |
91 | 91 |
92 DISALLOW_COPY_AND_ASSIGN(OzonePlatformCaca); | 92 DISALLOW_COPY_AND_ASSIGN(OzonePlatformCaca); |
93 }; | 93 }; |
94 | 94 |
95 } // namespace | 95 } // namespace |
96 | 96 |
97 OzonePlatform* CreateOzonePlatformCaca() { | 97 OzonePlatform* CreateOzonePlatformCaca() { |
98 return new OzonePlatformCaca; | 98 return new OzonePlatformCaca; |
99 } | 99 } |
100 | 100 |
101 } // namespace ui | 101 } // namespace ui |
OLD | NEW |