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

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

Issue 11417150: Implement workspace scrubbing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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.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 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 aura::Window* Workspace::ReleaseWindow() { 51 aura::Window* Workspace::ReleaseWindow() {
52 // Remove the LayoutManager and EventFilter as they refer back to us and/or 52 // Remove the LayoutManager and EventFilter as they refer back to us and/or
53 // WorkspaceManager. 53 // WorkspaceManager.
54 window_->SetLayoutManager(NULL); 54 window_->SetLayoutManager(NULL);
55 window_->SetEventFilter(NULL); 55 window_->SetEventFilter(NULL);
56 aura::Window* window = window_; 56 aura::Window* window = window_;
57 window_ = NULL; 57 window_ = NULL;
58 return window; 58 return window;
59 } 59 }
60 60
61 aura::Window* Workspace::GetActiveWindow() const {
62 aura::Window* active_window = wm::GetActiveWindow();
sky 2012/11/28 15:15:34 Did you see my earlier comment on this? I believe
63 if (!active_window)
64 return NULL;
65
66 // Only return the active window if it is in this workspace.
67 aura::Window* window = active_window;
68 while (window) {
69 if (window == window_)
70 return active_window;
71 window = window->parent();
72 }
73 return NULL;
74 }
75
61 bool Workspace::ShouldMoveToPending() const { 76 bool Workspace::ShouldMoveToPending() const {
62 if (!is_maximized_) 77 if (!is_maximized_)
63 return false; 78 return false;
64 79
65 bool has_visible_non_maximized_window = false; 80 bool has_visible_non_maximized_window = false;
66 for (size_t i = 0; i < window_->children().size(); ++i) { 81 for (size_t i = 0; i < window_->children().size(); ++i) {
67 aura::Window* child(window_->children()[i]); 82 aura::Window* child(window_->children()[i]);
68 if (!GetTrackedByWorkspace(child) || !child->TargetVisibility() || 83 if (!GetTrackedByWorkspace(child) || !child->TargetVisibility() ||
69 wm::IsWindowMinimized(child)) 84 wm::IsWindowMinimized(child))
70 continue; 85 continue;
(...skipping 15 matching lines...) Expand all
86 WorkspaceManager::WillRestoreMaximized(child))) { 101 WorkspaceManager::WillRestoreMaximized(child))) {
87 if (++count == 2) 102 if (++count == 2)
88 return count; 103 return count;
89 } 104 }
90 } 105 }
91 return count; 106 return count;
92 } 107 }
93 108
94 } // namespace internal 109 } // namespace internal
95 } // namespace ash 110 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698