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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 overlay_manager_.reset(new StubOverlayManager()); | 66 overlay_manager_.reset(new StubOverlayManager()); |
67 event_source_.reset(new CacaEventSource()); | 67 event_source_.reset(new CacaEventSource()); |
68 cursor_factory_ozone_.reset(new CursorFactoryOzone()); | 68 cursor_factory_ozone_.reset(new CursorFactoryOzone()); |
69 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); | 69 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); |
70 input_controller_ = CreateStubInputController(); | 70 input_controller_ = CreateStubInputController(); |
71 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( | 71 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( |
72 base::MakeUnique<NoKeyboardLayoutEngine>()); | 72 base::MakeUnique<NoKeyboardLayoutEngine>()); |
73 } | 73 } |
74 | 74 |
75 void InitializeGPU() override { | 75 void InitializeGPU() override { |
| 76 if (!window_manager_) { |
| 77 // The return value of GetSurfaceFactoryOzone() must be non-null so a |
| 78 // dummy instance of CacaWindowManager is needed to make the GPU |
| 79 // initialization gracefully fail. |
| 80 window_manager_.reset(new CacaWindowManager); |
| 81 } |
76 } | 82 } |
77 | 83 |
78 private: | 84 private: |
79 std::unique_ptr<CacaWindowManager> window_manager_; | 85 std::unique_ptr<CacaWindowManager> window_manager_; |
80 std::unique_ptr<CacaEventSource> event_source_; | 86 std::unique_ptr<CacaEventSource> event_source_; |
81 std::unique_ptr<CursorFactoryOzone> cursor_factory_ozone_; | 87 std::unique_ptr<CursorFactoryOzone> cursor_factory_ozone_; |
82 std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; | 88 std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; |
83 std::unique_ptr<InputController> input_controller_; | 89 std::unique_ptr<InputController> input_controller_; |
84 std::unique_ptr<OverlayManagerOzone> overlay_manager_; | 90 std::unique_ptr<OverlayManagerOzone> overlay_manager_; |
85 | 91 |
86 DISALLOW_COPY_AND_ASSIGN(OzonePlatformCaca); | 92 DISALLOW_COPY_AND_ASSIGN(OzonePlatformCaca); |
87 }; | 93 }; |
88 | 94 |
89 } // namespace | 95 } // namespace |
90 | 96 |
91 OzonePlatform* CreateOzonePlatformCaca() { | 97 OzonePlatform* CreateOzonePlatformCaca() { |
92 return new OzonePlatformCaca; | 98 return new OzonePlatformCaca; |
93 } | 99 } |
94 | 100 |
95 } // namespace ui | 101 } // namespace ui |
OLD | NEW |