Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/headless/ozone_platform_headless.h" | 5 #include "ui/ozone/platform/headless/ozone_platform_headless.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| 11 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" | 11 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h" |
| 12 #include "ui/display/chromeos/virtual_display_delegate.h" | |
|
rjkroege
2016/09/12 20:31:05
no. this code needs to build with chromeos=false
kylechar
2016/09/13 14:15:01
I could move it to src/ui/display/ then?
| |
| 12 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" | 13 #include "ui/events/ozone/layout/keyboard_layout_engine_manager.h" |
| 13 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h" | 14 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h" |
| 14 #include "ui/events/platform/platform_event_source.h" | 15 #include "ui/events/platform/platform_event_source.h" |
| 15 #include "ui/ozone/common/native_display_delegate_ozone.h" | |
| 16 #include "ui/ozone/common/stub_overlay_manager.h" | 16 #include "ui/ozone/common/stub_overlay_manager.h" |
| 17 #include "ui/ozone/platform/headless/headless_surface_factory.h" | 17 #include "ui/ozone/platform/headless/headless_surface_factory.h" |
| 18 #include "ui/ozone/platform/headless/headless_window.h" | 18 #include "ui/ozone/platform/headless/headless_window.h" |
| 19 #include "ui/ozone/platform/headless/headless_window_manager.h" | 19 #include "ui/ozone/platform/headless/headless_window_manager.h" |
| 20 #include "ui/ozone/public/cursor_factory_ozone.h" | 20 #include "ui/ozone/public/cursor_factory_ozone.h" |
| 21 #include "ui/ozone/public/gpu_platform_support_host.h" | 21 #include "ui/ozone/public/gpu_platform_support_host.h" |
| 22 #include "ui/ozone/public/input_controller.h" | 22 #include "ui/ozone/public/input_controller.h" |
| 23 #include "ui/ozone/public/ozone_platform.h" | 23 #include "ui/ozone/public/ozone_platform.h" |
| 24 #include "ui/ozone/public/ozone_switches.h" | 24 #include "ui/ozone/public/ozone_switches.h" |
| 25 #include "ui/ozone/public/system_input_injector.h" | 25 #include "ui/ozone/public/system_input_injector.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 return nullptr; // no input injection support. | 67 return nullptr; // no input injection support. |
| 68 } | 68 } |
| 69 std::unique_ptr<PlatformWindow> CreatePlatformWindow( | 69 std::unique_ptr<PlatformWindow> CreatePlatformWindow( |
| 70 PlatformWindowDelegate* delegate, | 70 PlatformWindowDelegate* delegate, |
| 71 const gfx::Rect& bounds) override { | 71 const gfx::Rect& bounds) override { |
| 72 return base::WrapUnique<PlatformWindow>( | 72 return base::WrapUnique<PlatformWindow>( |
| 73 new HeadlessWindow(delegate, window_manager_.get(), bounds)); | 73 new HeadlessWindow(delegate, window_manager_.get(), bounds)); |
| 74 } | 74 } |
| 75 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() | 75 std::unique_ptr<NativeDisplayDelegate> CreateNativeDisplayDelegate() |
| 76 override { | 76 override { |
| 77 return base::MakeUnique<NativeDisplayDelegateOzone>(); | 77 return base::MakeUnique<display::VirtualDisplayDelegate>(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void InitializeUI() override { | 80 void InitializeUI() override { |
| 81 window_manager_.reset(new HeadlessWindowManager(file_path_)); | 81 window_manager_.reset(new HeadlessWindowManager(file_path_)); |
| 82 window_manager_->Initialize(); | 82 window_manager_->Initialize(); |
| 83 surface_factory_.reset(new HeadlessSurfaceFactory(window_manager_.get())); | 83 surface_factory_.reset(new HeadlessSurfaceFactory(window_manager_.get())); |
| 84 // This unbreaks tests that create their own. | 84 // This unbreaks tests that create their own. |
| 85 if (!PlatformEventSource::GetInstance()) | 85 if (!PlatformEventSource::GetInstance()) |
| 86 platform_event_source_.reset(new HeadlessPlatformEventSource); | 86 platform_event_source_.reset(new HeadlessPlatformEventSource); |
| 87 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( | 87 KeyboardLayoutEngineManager::SetKeyboardLayoutEngine( |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 115 | 115 |
| 116 OzonePlatform* CreateOzonePlatformHeadless() { | 116 OzonePlatform* CreateOzonePlatformHeadless() { |
| 117 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); | 117 base::CommandLine* cmd = base::CommandLine::ForCurrentProcess(); |
| 118 base::FilePath location; | 118 base::FilePath location; |
| 119 if (cmd->HasSwitch(switches::kOzoneDumpFile)) | 119 if (cmd->HasSwitch(switches::kOzoneDumpFile)) |
| 120 location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile); | 120 location = cmd->GetSwitchValuePath(switches::kOzoneDumpFile); |
| 121 return new OzonePlatformHeadless(location); | 121 return new OzonePlatformHeadless(location); |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace ui | 124 } // namespace ui |
| OLD | NEW |