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

Side by Side Diff: extensions/shell/browser/shell_desktop_controller_aura.cc

Issue 1878903002: Use injection and remove ozone dependency from ui/display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix unique_ptr Created 4 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
« no previous file with comments | « extensions/shell/browser/DEPS ('k') | ui/display/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "extensions/shell/browser/shell_desktop_controller_aura.h" 5 #include "extensions/shell/browser/shell_desktop_controller_aura.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 24 matching lines...) Expand all
35 #include "ui/wm/core/cursor_manager.h" 35 #include "ui/wm/core/cursor_manager.h"
36 #include "ui/wm/core/focus_controller.h" 36 #include "ui/wm/core/focus_controller.h"
37 #include "ui/wm/core/native_cursor_manager.h" 37 #include "ui/wm/core/native_cursor_manager.h"
38 #include "ui/wm/core/native_cursor_manager_delegate.h" 38 #include "ui/wm/core/native_cursor_manager_delegate.h"
39 39
40 #if defined(OS_CHROMEOS) 40 #if defined(OS_CHROMEOS)
41 #include "chromeos/dbus/dbus_thread_manager.h" 41 #include "chromeos/dbus/dbus_thread_manager.h"
42 #include "ui/chromeos/user_activity_power_manager_notifier.h" 42 #include "ui/chromeos/user_activity_power_manager_notifier.h"
43 #include "ui/display/types/display_mode.h" 43 #include "ui/display/types/display_mode.h"
44 #include "ui/display/types/display_snapshot.h" 44 #include "ui/display/types/display_snapshot.h"
45
46 #if defined(USE_X11)
47 #include "ui/display/chromeos/x11/native_display_delegate_x11.h"
45 #endif 48 #endif
46 49
50 #if defined(USE_OZONE)
51 #include "ui/display/types/native_display_delegate.h"
52 #include "ui/ozone/public/ozone_platform.h"
53 #endif
54
55 #endif // defined(OS_CHROMEOS)
56
47 namespace extensions { 57 namespace extensions {
48 namespace { 58 namespace {
49 59
50 // A simple layout manager that makes each new window fill its parent. 60 // A simple layout manager that makes each new window fill its parent.
51 class FillLayout : public aura::LayoutManager { 61 class FillLayout : public aura::LayoutManager {
52 public: 62 public:
53 FillLayout() {} 63 FillLayout() {}
54 ~FillLayout() override {} 64 ~FillLayout() override {}
55 65
56 private: 66 private:
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 } // namespace 171 } // namespace
162 172
163 ShellDesktopControllerAura::ShellDesktopControllerAura() 173 ShellDesktopControllerAura::ShellDesktopControllerAura()
164 : app_window_client_(new ShellAppWindowClient) { 174 : app_window_client_(new ShellAppWindowClient) {
165 extensions::AppWindowClient::Set(app_window_client_.get()); 175 extensions::AppWindowClient::Set(app_window_client_.get());
166 176
167 #if defined(OS_CHROMEOS) 177 #if defined(OS_CHROMEOS)
168 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver( 178 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(
169 this); 179 this);
170 display_configurator_.reset(new ui::DisplayConfigurator); 180 display_configurator_.reset(new ui::DisplayConfigurator);
171 display_configurator_->Init(false); 181 #if defined(USE_OZONE)
182 display_configurator_->Init(
183 ui::OzonePlatform::GetInstance()->CreateNativeDisplayDelegate(), false);
184 #elif defined(USE_X11)
185 display_configurator_->Init(
186 base::WrapUnique(new ui::NativeDisplayDelegateX11()), false);
187 #endif
172 display_configurator_->ForceInitialConfigure(0); 188 display_configurator_->ForceInitialConfigure(0);
173 display_configurator_->AddObserver(this); 189 display_configurator_->AddObserver(this);
174 #endif 190 #endif
175 CreateRootWindow(); 191 CreateRootWindow();
176 } 192 }
177 193
178 ShellDesktopControllerAura::~ShellDesktopControllerAura() { 194 ShellDesktopControllerAura::~ShellDesktopControllerAura() {
179 CloseAppWindows(); 195 CloseAppWindows();
180 DestroyRootWindow(); 196 DestroyRootWindow();
181 #if defined(OS_CHROMEOS) 197 #if defined(OS_CHROMEOS)
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
339 if (displays.empty()) 355 if (displays.empty())
340 return gfx::Size(); 356 return gfx::Size();
341 const ui::DisplayMode* mode = displays[0]->current_mode(); 357 const ui::DisplayMode* mode = displays[0]->current_mode();
342 return mode ? mode->size() : gfx::Size(); 358 return mode ? mode->size() : gfx::Size();
343 #else 359 #else
344 return gfx::Size(); 360 return gfx::Size();
345 #endif 361 #endif
346 } 362 }
347 363
348 } // namespace extensions 364 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/shell/browser/DEPS ('k') | ui/display/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698