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

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

Issue 13867010: ash: Fix transient child in wrong workspace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months 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
« no previous file with comments | « no previous file | ash/wm/workspace/workspace_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.h" 5 #include "ash/wm/workspace/workspace.h"
6 6
7 #include "ash/shell_window_ids.h" 7 #include "ash/shell_window_ids.h"
8 #include "ash/wm/property_util.h" 8 #include "ash/wm/property_util.h"
9 #include "ash/wm/window_animations.h" 9 #include "ash/wm/window_animations.h"
10 #include "ash/wm/window_properties.h" 10 #include "ash/wm/window_properties.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 bool Workspace::ShouldMoveToPending() const { 72 bool Workspace::ShouldMoveToPending() const {
73 if (!is_maximized_) 73 if (!is_maximized_)
74 return false; 74 return false;
75 75
76 for (size_t i = 0; i < window_->children().size(); ++i) { 76 for (size_t i = 0; i < window_->children().size(); ++i) {
77 aura::Window* child(window_->children()[i]); 77 aura::Window* child(window_->children()[i]);
78 if (!child->TargetVisibility() || wm::IsWindowMinimized(child)) 78 if (!child->TargetVisibility() || wm::IsWindowMinimized(child))
79 continue; 79 continue;
80 80
81 if (!GetTrackedByWorkspace(child)) { 81 // If we have a maximized window don't move to pending.
82 // If we have a maximized window that isn't tracked don't move to 82 if (WorkspaceManager::IsMaximized(child))
sky 2013/04/16 22:33:25 I think this is going to break dragging a tab from
xiyuan 2013/04/16 22:52:49 I verified it still works. You can drag a tab out
sky 2013/04/16 23:23:30 Good point.
83 // pending. This handles the case of dragging a maximized window. 83 return false;
84 if (WorkspaceManager::IsMaximized(child))
85 return false;
86 continue;
87 }
88 84
89 if (!GetPersistsAcrossAllWorkspaces(child)) 85 if (GetTrackedByWorkspace(child) && !GetPersistsAcrossAllWorkspaces(child))
90 return false; 86 return false;
91 } 87 }
92 return true; 88 return true;
93 } 89 }
94 90
95 int Workspace::GetNumMaximizedWindows() const { 91 int Workspace::GetNumMaximizedWindows() const {
96 int count = 0; 92 int count = 0;
97 for (size_t i = 0; i < window_->children().size(); ++i) { 93 for (size_t i = 0; i < window_->children().size(); ++i) {
98 aura::Window* child = window_->children()[i]; 94 aura::Window* child = window_->children()[i];
99 if (GetTrackedByWorkspace(child) && 95 if (GetTrackedByWorkspace(child) &&
100 (WorkspaceManager::IsMaximized(child) || 96 (WorkspaceManager::IsMaximized(child) ||
101 WorkspaceManager::WillRestoreMaximized(child))) { 97 WorkspaceManager::WillRestoreMaximized(child))) {
102 if (++count == 2) 98 if (++count == 2)
103 return count; 99 return count;
104 } 100 }
105 } 101 }
106 return count; 102 return count;
107 } 103 }
108 104
109 } // namespace internal 105 } // namespace internal
110 } // namespace ash 106 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/wm/workspace/workspace_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698