| 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 "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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 229 bool down, | 229 bool down, |
| 230 const base::TimeTicks& timestamp) { | 230 const base::TimeTicks& timestamp) { |
| 231 if (down) { | 231 if (down) { |
| 232 chromeos::DBusThreadManager::Get() | 232 chromeos::DBusThreadManager::Get() |
| 233 ->GetPowerManagerClient() | 233 ->GetPowerManagerClient() |
| 234 ->RequestShutdown(); | 234 ->RequestShutdown(); |
| 235 } | 235 } |
| 236 } | 236 } |
| 237 | 237 |
| 238 void ShellDesktopControllerAura::OnDisplayModeChanged( | 238 void ShellDesktopControllerAura::OnDisplayModeChanged( |
| 239 const std::vector<ui::DisplayConfigurator::DisplayState>& displays) { | 239 const ui::DisplayConfigurator::DisplayStateList& displays) { |
| 240 gfx::Size size = GetPrimaryDisplaySize(); | 240 gfx::Size size = GetPrimaryDisplaySize(); |
| 241 if (!size.IsEmpty()) | 241 if (!size.IsEmpty()) |
| 242 host_->UpdateRootWindowSize(size); | 242 host_->UpdateRootWindowSize(size); |
| 243 } | 243 } |
| 244 #endif | 244 #endif |
| 245 | 245 |
| 246 void ShellDesktopControllerAura::OnHostCloseRequested( | 246 void ShellDesktopControllerAura::OnHostCloseRequested( |
| 247 const aura::WindowTreeHost* host) { | 247 const aura::WindowTreeHost* host) { |
| 248 DCHECK_EQ(host_.get(), host); | 248 DCHECK_EQ(host_.get(), host); |
| 249 CloseAppWindows(); | 249 CloseAppWindows(); |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 #if defined(OS_CHROMEOS) | 336 #if defined(OS_CHROMEOS) |
| 337 user_activity_notifier_.reset(); | 337 user_activity_notifier_.reset(); |
| 338 #endif | 338 #endif |
| 339 user_activity_detector_.reset(); | 339 user_activity_detector_.reset(); |
| 340 host_.reset(); | 340 host_.reset(); |
| 341 screen_.reset(); | 341 screen_.reset(); |
| 342 } | 342 } |
| 343 | 343 |
| 344 gfx::Size ShellDesktopControllerAura::GetPrimaryDisplaySize() { | 344 gfx::Size ShellDesktopControllerAura::GetPrimaryDisplaySize() { |
| 345 #if defined(OS_CHROMEOS) | 345 #if defined(OS_CHROMEOS) |
| 346 const std::vector<ui::DisplayConfigurator::DisplayState>& displays = | 346 const ui::DisplayConfigurator::DisplayStateList& displays = |
| 347 display_configurator_->cached_displays(); | 347 display_configurator_->cached_displays(); |
| 348 if (displays.empty()) | 348 if (displays.empty()) |
| 349 return gfx::Size(); | 349 return gfx::Size(); |
| 350 const ui::DisplayMode* mode = displays[0].display->current_mode(); | 350 const ui::DisplayMode* mode = displays[0]->current_mode(); |
| 351 return mode ? mode->size() : gfx::Size(); | 351 return mode ? mode->size() : gfx::Size(); |
| 352 #else | 352 #else |
| 353 return gfx::Size(); | 353 return gfx::Size(); |
| 354 #endif | 354 #endif |
| 355 } | 355 } |
| 356 | 356 |
| 357 } // namespace extensions | 357 } // namespace extensions |
| OLD | NEW |