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

Side by Side Diff: ash/wm/workspace/workspace_manager.cc

Issue 11421006: Desktop aura: Break aura::Window::SetParent in two. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix ash_unittests Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/wm/workspace/workspace_manager.h" 5 #include "ash/wm/workspace/workspace_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 9
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // Amount of time to pause before animating anything. Only used during initial 55 // Amount of time to pause before animating anything. Only used during initial
56 // animation (when logging in). 56 // animation (when logging in).
57 const int kInitialPauseTimeMS = 750; 57 const int kInitialPauseTimeMS = 750;
58 58
59 // Changes the parent of |window| and all its transient children to 59 // Changes the parent of |window| and all its transient children to
60 // |new_parent|. If |stack_beneach| is non-NULL all the windows are stacked 60 // |new_parent|. If |stack_beneach| is non-NULL all the windows are stacked
61 // beneath it. 61 // beneath it.
62 void ReparentWindow(Window* window, 62 void ReparentWindow(Window* window,
63 Window* new_parent, 63 Window* new_parent,
64 Window* stack_beneath) { 64 Window* stack_beneath) {
65 window->SetParent(new_parent); 65 new_parent->AddChild(window);
66 if (stack_beneath) 66 if (stack_beneath)
67 new_parent->StackChildBelow(window, stack_beneath); 67 new_parent->StackChildBelow(window, stack_beneath);
68 for (size_t i = 0; i < window->transient_children().size(); ++i) 68 for (size_t i = 0; i < window->transient_children().size(); ++i)
69 ReparentWindow(window->transient_children()[i], new_parent, stack_beneath); 69 ReparentWindow(window->transient_children()[i], new_parent, stack_beneath);
70 } 70 }
71 71
72 } // namespace 72 } // namespace
73 73
74 // Workspace ------------------------------------------------------------------- 74 // Workspace -------------------------------------------------------------------
75 75
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
736 new_workspace->window()->Show(); 736 new_workspace->window()->Show();
737 ReparentWindow(window, new_workspace->window(), NULL); 737 ReparentWindow(window, new_workspace->window(), NULL);
738 if (is_active) { 738 if (is_active) {
739 SetActiveWorkspace(new_workspace, SWITCH_TRACKED_BY_WORKSPACE_CHANGED, 739 SetActiveWorkspace(new_workspace, SWITCH_TRACKED_BY_WORKSPACE_CHANGED,
740 base::TimeDelta()); 740 base::TimeDelta());
741 } 741 }
742 } 742 }
743 743
744 } // namespace internal 744 } // namespace internal
745 } // namespace ash 745 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/workspace/workspace_layout_manager_unittest.cc ('k') | ash/wm/workspace/workspace_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698