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

Unified Diff: ash/wm/root_window_layout_manager.cc

Issue 1484383003: Use WindowTracker when resizing root window as it may delete other window in unit tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/panels/panel_layout_manager.cc ('k') | ash/wm/root_window_layout_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/root_window_layout_manager.cc
diff --git a/ash/wm/root_window_layout_manager.cc b/ash/wm/root_window_layout_manager.cc
index 65b71f44b9bd692ac5d99b298c92a279af889724..542bbecaf9b0e76bee0b09776027531702ca0eb4 100644
--- a/ash/wm/root_window_layout_manager.cc
+++ b/ash/wm/root_window_layout_manager.cc
@@ -7,6 +7,7 @@
#include "ash/desktop_background/desktop_background_widget_controller.h"
#include "ash/root_window_controller.h"
#include "ui/aura/window_event_dispatcher.h"
+#include "ui/aura/window_tracker.h"
#include "ui/compositor/layer.h"
#include "ui/views/widget/widget.h"
@@ -32,12 +33,13 @@ void RootWindowLayoutManager::OnWindowResized() {
// Resize both our immediate children (the containers-of-containers animated
// by PowerButtonController) and their children (the actual containers).
- aura::Window::Windows::const_iterator i;
- for (i = owner_->children().begin(); i != owner_->children().end(); ++i) {
- (*i)->SetBounds(fullscreen_bounds);
- aura::Window::Windows::const_iterator j;
- for (j = (*i)->children().begin(); j != (*i)->children().end(); ++j)
- (*j)->SetBounds(fullscreen_bounds);
+ aura::WindowTracker children_tracker(owner_->children());
+ while (children_tracker.has_windows()) {
+ aura::Window* child = children_tracker.Pop();
+ child->SetBounds(fullscreen_bounds);
+ aura::WindowTracker grandchildren_tracker(child->children());
+ while (grandchildren_tracker.has_windows())
+ grandchildren_tracker.Pop()->SetBounds(fullscreen_bounds);
}
RootWindowController* root_window_controller =
GetRootWindowController(owner_);
« no previous file with comments | « ash/wm/panels/panel_layout_manager.cc ('k') | ash/wm/root_window_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698