OLD | NEW |
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 "ash/wm/overview/window_overview.h" | 5 #include "ash/wm/overview/window_overview.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ash/screen_ash.h" | 9 #include "ash/screen_ash.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 for (WindowSelectorItemList::iterator iter = windows_->begin(); | 307 for (WindowSelectorItemList::iterator iter = windows_->begin(); |
308 iter != windows_->end(); ++iter) { | 308 iter != windows_->end(); ++iter) { |
309 aura::Window* selected = (*iter)->TargetedWindow(window); | 309 aura::Window* selected = (*iter)->TargetedWindow(window); |
310 if (selected) | 310 if (selected) |
311 return selected; | 311 return selected; |
312 } | 312 } |
313 return NULL; | 313 return NULL; |
314 } | 314 } |
315 | 315 |
316 void WindowOverview::HideAndTrackNonOverviewWindows() { | 316 void WindowOverview::HideAndTrackNonOverviewWindows() { |
317 Shell::RootWindowList root_windows = Shell::GetAllRootWindows(); | 317 aura::Window::Windows root_windows = Shell::GetAllRootWindows(); |
318 for (Shell::RootWindowList::const_iterator root_iter = root_windows.begin(); | 318 for (aura::Window::Windows::const_iterator root_iter = root_windows.begin(); |
319 root_iter != root_windows.end(); ++root_iter) { | 319 root_iter != root_windows.end(); ++root_iter) { |
320 for (size_t i = 0; i < kSwitchableWindowContainerIdsLength; ++i) { | 320 for (size_t i = 0; i < kSwitchableWindowContainerIdsLength; ++i) { |
321 aura::Window* container = Shell::GetContainer(*root_iter, | 321 aura::Window* container = Shell::GetContainer(*root_iter, |
322 kSwitchableWindowContainerIds[i]); | 322 kSwitchableWindowContainerIds[i]); |
323 // Copy the children list as it can change during iteration. | 323 // Copy the children list as it can change during iteration. |
324 aura::Window::Windows children(container->children()); | 324 aura::Window::Windows children(container->children()); |
325 for (aura::Window::Windows::const_iterator iter = children.begin(); | 325 for (aura::Window::Windows::const_iterator iter = children.begin(); |
326 iter != children.end(); ++iter) { | 326 iter != children.end(); ++iter) { |
327 if (GetTargetedWindow(*iter) || !(*iter)->IsVisible()) | 327 if (GetTargetedWindow(*iter) || !(*iter)->IsVisible()) |
328 continue; | 328 continue; |
(...skipping 13 matching lines...) Expand all Loading... |
342 | 342 |
343 void WindowOverview::PositionWindows() { | 343 void WindowOverview::PositionWindows() { |
344 if (single_root_window_) { | 344 if (single_root_window_) { |
345 std::vector<WindowSelectorItem*> windows; | 345 std::vector<WindowSelectorItem*> windows; |
346 for (WindowSelectorItemList::iterator iter = windows_->begin(); | 346 for (WindowSelectorItemList::iterator iter = windows_->begin(); |
347 iter != windows_->end(); ++iter) { | 347 iter != windows_->end(); ++iter) { |
348 windows.push_back(*iter); | 348 windows.push_back(*iter); |
349 } | 349 } |
350 PositionWindowsOnRoot(single_root_window_, windows); | 350 PositionWindowsOnRoot(single_root_window_, windows); |
351 } else { | 351 } else { |
352 Shell::RootWindowList root_window_list = Shell::GetAllRootWindows(); | 352 aura::Window::Windows root_window_list = Shell::GetAllRootWindows(); |
353 for (size_t i = 0; i < root_window_list.size(); ++i) | 353 for (size_t i = 0; i < root_window_list.size(); ++i) |
354 PositionWindowsFromRoot(root_window_list[i]); | 354 PositionWindowsFromRoot(root_window_list[i]); |
355 } | 355 } |
356 } | 356 } |
357 | 357 |
358 void WindowOverview::PositionWindowsFromRoot(aura::Window* root_window) { | 358 void WindowOverview::PositionWindowsFromRoot(aura::Window* root_window) { |
359 std::vector<WindowSelectorItem*> windows; | 359 std::vector<WindowSelectorItem*> windows; |
360 for (WindowSelectorItemList::iterator iter = windows_->begin(); | 360 for (WindowSelectorItemList::iterator iter = windows_->begin(); |
361 iter != windows_->end(); ++iter) { | 361 iter != windows_->end(); ++iter) { |
362 if ((*iter)->GetRootWindow() == root_window) | 362 if ((*iter)->GetRootWindow() == root_window) |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 } | 434 } |
435 | 435 |
436 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) { | 436 gfx::Rect WindowOverview::GetSelectionBounds(size_t index) { |
437 gfx::Rect bounds((*windows_)[index]->bounds()); | 437 gfx::Rect bounds((*windows_)[index]->bounds()); |
438 bounds.Inset(-kWindowOverviewSelectionPadding, | 438 bounds.Inset(-kWindowOverviewSelectionPadding, |
439 -kWindowOverviewSelectionPadding); | 439 -kWindowOverviewSelectionPadding); |
440 return bounds; | 440 return bounds; |
441 } | 441 } |
442 | 442 |
443 } // namespace ash | 443 } // namespace ash |
OLD | NEW |