OLD | NEW |
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 | 8 |
9 #include "ash/screen_ash.h" | 9 #include "ash/screen_ash.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 | 134 |
135 void WorkspaceManager::UpdateShelfVisibility() { | 135 void WorkspaceManager::UpdateShelfVisibility() { |
136 if (shelf_) | 136 if (shelf_) |
137 shelf_->UpdateVisibilityState(); | 137 shelf_->UpdateVisibilityState(); |
138 } | 138 } |
139 | 139 |
140 WorkspaceManager::WindowState WorkspaceManager::GetWindowState() { | 140 WorkspaceManager::WindowState WorkspaceManager::GetWindowState() { |
141 if (!shelf_ || !active_workspace_) | 141 if (!shelf_ || !active_workspace_) |
142 return WINDOW_STATE_DEFAULT; | 142 return WINDOW_STATE_DEFAULT; |
143 | 143 |
144 // TODO: this code needs to be made multi-monitor aware. | 144 // TODO: this code needs to be made multi-display aware. |
145 gfx::Rect shelf_bounds(shelf_->GetIdealBounds()); | 145 gfx::Rect shelf_bounds(shelf_->GetIdealBounds()); |
146 const aura::Window::Windows& windows(contents_view_->children()); | 146 const aura::Window::Windows& windows(contents_view_->children()); |
147 bool window_overlaps_launcher = false; | 147 bool window_overlaps_launcher = false; |
148 bool has_maximized_window = false; | 148 bool has_maximized_window = false; |
149 for (aura::Window::Windows::const_iterator i = windows.begin(); | 149 for (aura::Window::Windows::const_iterator i = windows.begin(); |
150 i != windows.end(); ++i) { | 150 i != windows.end(); ++i) { |
151 ui::Layer* layer = (*i)->layer(); | 151 ui::Layer* layer = (*i)->layer(); |
152 if (!layer->GetTargetVisibility() || layer->GetTargetOpacity() == 0.0f) | 152 if (!layer->GetTargetVisibility() || layer->GetTargetOpacity() == 0.0f) |
153 continue; | 153 continue; |
154 if (wm::IsWindowMaximized(*i)) { | 154 if (wm::IsWindowMaximized(*i)) { |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 return workspace; | 341 return workspace; |
342 } | 342 } |
343 | 343 |
344 void WorkspaceManager::CleanupWorkspace(Workspace* workspace) { | 344 void WorkspaceManager::CleanupWorkspace(Workspace* workspace) { |
345 if (workspace->type() != Workspace::TYPE_MANAGED && workspace->is_empty()) | 345 if (workspace->type() != Workspace::TYPE_MANAGED && workspace->is_empty()) |
346 delete workspace; | 346 delete workspace; |
347 } | 347 } |
348 | 348 |
349 } // namespace internal | 349 } // namespace internal |
350 } // namespace ash | 350 } // namespace ash |
OLD | NEW |