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/shell.h" | 9 #include "ash/shell.h" |
10 #include "ash/wm/property_util.h" | 10 #include "ash/wm/property_util.h" |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 BuildWindowList(workspace->windows(), &children); | 273 BuildWindowList(workspace->windows(), &children); |
274 SetWindowLayerVisibility(children, change_type, value); | 274 SetWindowLayerVisibility(children, change_type, value); |
275 } | 275 } |
276 | 276 |
277 void WorkspaceManager::SetWindowLayerVisibility( | 277 void WorkspaceManager::SetWindowLayerVisibility( |
278 const std::vector<aura::Window*>& windows, | 278 const std::vector<aura::Window*>& windows, |
279 AnimateChangeType change_type, | 279 AnimateChangeType change_type, |
280 bool value) { | 280 bool value) { |
281 for (size_t i = 0; i < windows.size(); ++i) { | 281 for (size_t i = 0; i < windows.size(); ++i) { |
282 ui::Layer* layer = windows[i]->layer(); | 282 ui::Layer* layer = windows[i]->layer(); |
283 if (layer) { | 283 // Only show the layer for windows that want to be visible. |
| 284 if (layer && (!value || windows[i]->TargetVisibility())) { |
284 windows[i]->SetProperty(aura::client::kAnimationsDisabledKey, | 285 windows[i]->SetProperty(aura::client::kAnimationsDisabledKey, |
285 change_type == DONT_ANIMATE); | 286 change_type == DONT_ANIMATE); |
286 bool update_layer = true; | 287 bool update_layer = true; |
287 if (change_type == ANIMATE) { | 288 if (change_type == ANIMATE) { |
288 ash::SetWindowVisibilityAnimationType( | 289 ash::SetWindowVisibilityAnimationType( |
289 windows[i], | 290 windows[i], |
290 value ? ash::WINDOW_VISIBILITY_ANIMATION_TYPE_WORKSPACE_SHOW : | 291 value ? ash::WINDOW_VISIBILITY_ANIMATION_TYPE_WORKSPACE_SHOW : |
291 ash::WINDOW_VISIBILITY_ANIMATION_TYPE_WORKSPACE_HIDE); | 292 ash::WINDOW_VISIBILITY_ANIMATION_TYPE_WORKSPACE_HIDE); |
292 if (ash::internal::AnimateOnChildWindowVisibilityChanged( | 293 if (ash::internal::AnimateOnChildWindowVisibilityChanged( |
293 windows[i], value)) | 294 windows[i], value)) |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 if (type == Workspace::TYPE_MAXIMIZED) | 417 if (type == Workspace::TYPE_MAXIMIZED) |
417 workspace = new MaximizedWorkspace(this); | 418 workspace = new MaximizedWorkspace(this); |
418 else | 419 else |
419 workspace = new ManagedWorkspace(this); | 420 workspace = new ManagedWorkspace(this); |
420 AddWorkspace(workspace); | 421 AddWorkspace(workspace); |
421 return workspace; | 422 return workspace; |
422 } | 423 } |
423 | 424 |
424 } // namespace internal | 425 } // namespace internal |
425 } // namespace ash | 426 } // namespace ash |
OLD | NEW |