| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 // Create a copy of the window vector, because closing the windows will | 233 // Create a copy of the window vector, because closing the windows will |
| 234 // trigger RemoveAppWindow, which will invalidate the iterator. | 234 // trigger RemoveAppWindow, which will invalidate the iterator. |
| 235 // This vector should be small enough that this should not be an issue. | 235 // This vector should be small enough that this should not be an issue. |
| 236 std::vector<AppWindow*> app_windows(app_windows_); | 236 std::vector<AppWindow*> app_windows(app_windows_); |
| 237 for (AppWindow* app_window : app_windows) | 237 for (AppWindow* app_window : app_windows) |
| 238 app_window->GetBaseWindow()->Close(); // Close() deletes |app_window|. | 238 app_window->GetBaseWindow()->Close(); // Close() deletes |app_window|. |
| 239 app_windows_.clear(); | 239 app_windows_.clear(); |
| 240 } | 240 } |
| 241 | 241 |
| 242 aura::Window* ShellDesktopControllerAura::GetDefaultParent( | 242 aura::Window* ShellDesktopControllerAura::GetDefaultParent( |
| 243 aura::Window* context, | |
| 244 aura::Window* window, | 243 aura::Window* window, |
| 245 const gfx::Rect& bounds) { | 244 const gfx::Rect& bounds) { |
| 246 return host_->window(); | 245 return host_->window(); |
| 247 } | 246 } |
| 248 | 247 |
| 249 #if defined(OS_CHROMEOS) | 248 #if defined(OS_CHROMEOS) |
| 250 void ShellDesktopControllerAura::PowerButtonEventReceived( | 249 void ShellDesktopControllerAura::PowerButtonEventReceived( |
| 251 bool down, | 250 bool down, |
| 252 const base::TimeTicks& timestamp) { | 251 const base::TimeTicks& timestamp) { |
| 253 if (down) { | 252 if (down) { |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 if (displays.empty()) | 390 if (displays.empty()) |
| 392 return gfx::Size(); | 391 return gfx::Size(); |
| 393 const display::DisplayMode* mode = displays[0]->current_mode(); | 392 const display::DisplayMode* mode = displays[0]->current_mode(); |
| 394 return mode ? mode->size() : gfx::Size(); | 393 return mode ? mode->size() : gfx::Size(); |
| 395 #else | 394 #else |
| 396 return gfx::Size(); | 395 return gfx::Size(); |
| 397 #endif | 396 #endif |
| 398 } | 397 } |
| 399 | 398 |
| 400 } // namespace extensions | 399 } // namespace extensions |
| OLD | NEW |