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

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

Issue 10977016: Fixing issue with Talk window getting maximized, minimized, restored and leaving it in a desolate s… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added comment. Created 8 years, 2 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 | no next file » | 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_manager2.h" 5 #include "ash/wm/workspace/workspace_manager2.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <functional> 8 #include <functional>
9 9
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 } 194 }
195 195
196 void WorkspaceManager2::SetActiveWorkspaceByWindow(Window* window) { 196 void WorkspaceManager2::SetActiveWorkspaceByWindow(Window* window) {
197 Workspace2* workspace = FindBy(window); 197 Workspace2* workspace = FindBy(window);
198 if (!workspace) 198 if (!workspace)
199 return; 199 return;
200 200
201 if (workspace != active_workspace_) { 201 if (workspace != active_workspace_) {
202 // If the window persists across all workspaces, move it to the current 202 // If the window persists across all workspaces, move it to the current
203 // workspace. 203 // workspace.
204 if (GetPersistsAcrossAllWorkspaces(window) && !IsMaximized(window)) 204 // A popup which was first maximized, is minimized and getts restored has
205 // to go through the SetActiveWorkspace since it persists across workspaces
206 // and is not (yet) maximized (see crbug.com/151698).
207 if (GetPersistsAcrossAllWorkspaces(window) && !IsMaximized(window) &&
208 !(wm::IsWindowMinimized(window) && WillRestoreMaximized(window)))
205 ReparentWindow(window, active_workspace_->window(), NULL); 209 ReparentWindow(window, active_workspace_->window(), NULL);
206 else 210 else
207 SetActiveWorkspace(workspace, ANIMATE_OLD_AND_NEW); 211 SetActiveWorkspace(workspace, ANIMATE_OLD_AND_NEW);
208 } 212 }
209 } 213 }
210 214
211 Window* WorkspaceManager2::GetParentForNewWindow(Window* window) { 215 Window* WorkspaceManager2::GetParentForNewWindow(Window* window) {
212 // Try to put windows with transient parents in the same workspace as their 216 // Try to put windows with transient parents in the same workspace as their
213 // transient parent. 217 // transient parent.
214 if (window->transient_parent() && !IsMaximized(window)) { 218 if (window->transient_parent() && !IsMaximized(window)) {
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 if (last_show_state == ui::SHOW_STATE_MINIMIZED) 572 if (last_show_state == ui::SHOW_STATE_MINIMIZED)
569 SetUnminimizingWorkspace(new_workspace ? new_workspace : workspace); 573 SetUnminimizingWorkspace(new_workspace ? new_workspace : workspace);
570 DCHECK(!old_layer); 574 DCHECK(!old_layer);
571 } 575 }
572 } 576 }
573 UpdateShelfVisibility(); 577 UpdateShelfVisibility();
574 } 578 }
575 579
576 } // namespace internal 580 } // namespace internal
577 } // namespace ash 581 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698