Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(184)

Side by Side Diff: ui/ozone/platform/headless/ozone_platform_headless.cc

Issue 2765263002: Remove deprecated Ozone initialization functions. (Closed)
Patch Set: Rebase. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
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<display::NativeDisplayDelegate> CreateNativeDisplayDelegate() 75 std::unique_ptr<display::NativeDisplayDelegate> CreateNativeDisplayDelegate()
76 override { 76 override {
77 return base::MakeUnique<display::FakeDisplayDelegate>(); 77 return base::MakeUnique<display::FakeDisplayDelegate>();
78 } 78 }
79 79
80 void InitializeUI() override { 80 void InitializeUI(const InitParams& params) 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(
88 base::MakeUnique<StubKeyboardLayoutEngine>()); 88 base::MakeUnique<StubKeyboardLayoutEngine>());
89 89
90 overlay_manager_.reset(new StubOverlayManager()); 90 overlay_manager_.reset(new StubOverlayManager());
91 input_controller_ = CreateStubInputController(); 91 input_controller_ = CreateStubInputController();
92 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone); 92 cursor_factory_ozone_.reset(new BitmapCursorFactoryOzone);
93 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost()); 93 gpu_platform_support_host_.reset(CreateStubGpuPlatformSupportHost());
94 } 94 }
95 95
96 void InitializeGPU() override { 96 void InitializeGPU(const InitParams& params) override {
97 if (!surface_factory_) 97 if (!surface_factory_)
98 surface_factory_.reset(new HeadlessSurfaceFactory()); 98 surface_factory_.reset(new HeadlessSurfaceFactory());
99 } 99 }
100 100
101 private: 101 private:
102 std::unique_ptr<HeadlessWindowManager> window_manager_; 102 std::unique_ptr<HeadlessWindowManager> window_manager_;
103 std::unique_ptr<HeadlessSurfaceFactory> surface_factory_; 103 std::unique_ptr<HeadlessSurfaceFactory> surface_factory_;
104 std::unique_ptr<PlatformEventSource> platform_event_source_; 104 std::unique_ptr<PlatformEventSource> platform_event_source_;
105 std::unique_ptr<CursorFactoryOzone> cursor_factory_ozone_; 105 std::unique_ptr<CursorFactoryOzone> cursor_factory_ozone_;
106 std::unique_ptr<InputController> input_controller_; 106 std::unique_ptr<InputController> input_controller_;
107 std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_; 107 std::unique_ptr<GpuPlatformSupportHost> gpu_platform_support_host_;
108 std::unique_ptr<OverlayManagerOzone> overlay_manager_; 108 std::unique_ptr<OverlayManagerOzone> overlay_manager_;
109 base::FilePath file_path_; 109 base::FilePath file_path_;
110 110
111 DISALLOW_COPY_AND_ASSIGN(OzonePlatformHeadless); 111 DISALLOW_COPY_AND_ASSIGN(OzonePlatformHeadless);
112 }; 112 };
113 113
114 } // namespace 114 } // namespace
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
OLDNEW
« no previous file with comments | « ui/ozone/platform/drm/ozone_platform_gbm.cc ('k') | ui/ozone/platform/wayland/ozone_platform_wayland.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698