| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ash/display/display_controller.h" | 5 #include "ash/display/display_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 controller->CloseChildWindows(); | 334 controller->CloseChildWindows(); |
| 335 } else { | 335 } else { |
| 336 while (!root_window->children().empty()) { | 336 while (!root_window->children().empty()) { |
| 337 aura::Window* child = root_window->children()[0]; | 337 aura::Window* child = root_window->children()[0]; |
| 338 delete child; | 338 delete child; |
| 339 } | 339 } |
| 340 } | 340 } |
| 341 } | 341 } |
| 342 } | 342 } |
| 343 | 343 |
| 344 aura::Window::Windows DisplayController::GetAllRootWindows() { | 344 std::vector<aura::RootWindow*> DisplayController::GetAllRootWindows() { |
| 345 aura::Window::Windows windows; | 345 std::vector<aura::RootWindow*> windows; |
| 346 for (std::map<int64, aura::RootWindow*>::const_iterator it = | 346 for (std::map<int64, aura::RootWindow*>::const_iterator it = |
| 347 root_windows_.begin(); it != root_windows_.end(); ++it) { | 347 root_windows_.begin(); it != root_windows_.end(); ++it) { |
| 348 DCHECK(it->second); | 348 DCHECK(it->second); |
| 349 if (internal::GetRootWindowController(it->second)) | 349 if (internal::GetRootWindowController(it->second)) |
| 350 windows.push_back(it->second); | 350 windows.push_back(it->second); |
| 351 } | 351 } |
| 352 return windows; | 352 return windows; |
| 353 } | 353 } |
| 354 | 354 |
| 355 gfx::Insets DisplayController::GetOverscanInsets(int64 display_id) const { | 355 gfx::Insets DisplayController::GetOverscanInsets(int64 display_id) const { |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 783 Shell::GetInstance()->output_configurator_animation()->StartFadeInAnimation(); | 783 Shell::GetInstance()->output_configurator_animation()->StartFadeInAnimation(); |
| 784 #endif | 784 #endif |
| 785 } | 785 } |
| 786 | 786 |
| 787 void DisplayController::UpdateHostWindowNames() { | 787 void DisplayController::UpdateHostWindowNames() { |
| 788 #if defined(USE_X11) | 788 #if defined(USE_X11) |
| 789 // crbug.com/120229 - set the window title for the primary dislpay | 789 // crbug.com/120229 - set the window title for the primary dislpay |
| 790 // to "aura_root_0" so gtalk can find the primary root window to broadcast. | 790 // to "aura_root_0" so gtalk can find the primary root window to broadcast. |
| 791 // TODO(jhorwich) Remove this once Chrome supports window-based broadcasting. | 791 // TODO(jhorwich) Remove this once Chrome supports window-based broadcasting. |
| 792 aura::Window* primary = Shell::GetPrimaryRootWindow(); | 792 aura::Window* primary = Shell::GetPrimaryRootWindow(); |
| 793 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); | 793 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); |
| 794 for (size_t i = 0; i < root_windows.size(); ++i) { | 794 for (size_t i = 0; i < root_windows.size(); ++i) { |
| 795 std::string name = | 795 std::string name = |
| 796 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; | 796 root_windows[i] == primary ? "aura_root_0" : "aura_root_x"; |
| 797 gfx::AcceleratedWidget xwindow = | 797 gfx::AcceleratedWidget xwindow = |
| 798 root_windows[i]->GetDispatcher()->GetAcceleratedWidget(); | 798 root_windows[i]->GetDispatcher()->GetAcceleratedWidget(); |
| 799 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); | 799 XStoreName(gfx::GetXDisplay(), xwindow, name.c_str()); |
| 800 } | 800 } |
| 801 #endif | 801 #endif |
| 802 } | 802 } |
| 803 | 803 |
| 804 } // namespace ash | 804 } // namespace ash |
| OLD | NEW |