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

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

Issue 9233044: Acquire all layers when hiding window gets destroyed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: dcheck Created 8 years, 10 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 | « ash/shell.cc ('k') | ash/wm/window_animations.h » ('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/visibility_controller.h" 5 #include "ash/wm/visibility_controller.h"
6 6
7 #include "ash/wm/window_animations.h" 7 #include "ash/wm/window_animations.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 9
10 namespace ash { 10 namespace ash {
(...skipping 17 matching lines...) Expand all
28 } 28 }
29 29
30 VisibilityController::~VisibilityController() { 30 VisibilityController::~VisibilityController() {
31 } 31 }
32 32
33 void VisibilityController::UpdateLayerVisibility(aura::Window* window, 33 void VisibilityController::UpdateLayerVisibility(aura::Window* window,
34 bool visible) { 34 bool visible) {
35 bool animated = GetChildWindowVisibilityChangesAnimated(window->parent()) && 35 bool animated = GetChildWindowVisibilityChangesAnimated(window->parent()) &&
36 window->type() != aura::client::WINDOW_TYPE_CONTROL && 36 window->type() != aura::client::WINDOW_TYPE_CONTROL &&
37 window->type() != aura::client::WINDOW_TYPE_UNKNOWN; 37 window->type() != aura::client::WINDOW_TYPE_UNKNOWN;
38 if (animated) 38 animated = animated && AnimateOnChildWindowVisibilityChanged(window, visible);
39 AnimateOnChildWindowVisibilityChanged(window, visible);
40 39
41 // When a window is made visible, we always make its layer visible 40 // When a window is made visible, we always make its layer visible
42 // immediately. When a window is hidden, the layer must be left visible and 41 // immediately. When a window is hidden, the layer must be left visible and
43 // only made not visible once the animation is complete. 42 // only made not visible once the animation is complete.
44 if (!animated || visible) 43 if (!animated || visible)
45 window->layer()->SetVisible(visible); 44 window->layer()->SetVisible(visible);
46 } 45 }
47 46
48 } // namespace internal 47 } // namespace internal
49 48
50 void SetChildWindowVisibilityChangesAnimated(aura::Window* window) { 49 void SetChildWindowVisibilityChangesAnimated(aura::Window* window) {
51 window->SetIntProperty(internal::kChildWindowVisibilityChangesAnimated, 1); 50 window->SetIntProperty(internal::kChildWindowVisibilityChangesAnimated, 1);
52 } 51 }
53 52
54 } // namespace ash 53 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.cc ('k') | ash/wm/window_animations.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698