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

Side by Side Diff: ui/wm/core/visibility_controller.cc

Issue 2632543003: Refactor and push window properties up to class properties. (Closed)
Patch Set: More build fixes Created 3 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
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 "ui/wm/core/visibility_controller.h" 5 #include "ui/wm/core/visibility_controller.h"
6 6
7 #include "ui/aura/window.h" 7 #include "ui/aura/window.h"
8 #include "ui/aura/window_property.h" 8 #include "ui/base/class_property.h"
9 #include "ui/compositor/layer.h" 9 #include "ui/compositor/layer.h"
10 #include "ui/wm/core/window_animations.h" 10 #include "ui/wm/core/window_animations.h"
11 11
12 namespace wm { 12 namespace wm {
13 13
14 namespace { 14 namespace {
15 15
16 // Property set on all windows whose child windows' visibility changes are 16 // Property set on all windows whose child windows' visibility changes are
17 // animated. 17 // animated.
18 DEFINE_WINDOW_PROPERTY_KEY( 18 DEFINE_UI_CLASS_PROPERTY_KEY(
19 bool, kChildWindowVisibilityChangesAnimatedKey, false); 19 bool, kChildWindowVisibilityChangesAnimatedKey, false);
20 20
21 // A window with this property set will animate upon its visibility changes. 21 // A window with this property set will animate upon its visibility changes.
22 DEFINE_WINDOW_PROPERTY_KEY(bool, kWindowVisibilityChangesAnimatedKey, false); 22 DEFINE_UI_CLASS_PROPERTY_KEY(bool, kWindowVisibilityChangesAnimatedKey, false);
23 23
24 bool ShouldAnimateWindow(aura::Window* window) { 24 bool ShouldAnimateWindow(aura::Window* window) {
25 return (window->parent() && 25 return (window->parent() &&
26 window->parent()->GetProperty( 26 window->parent()->GetProperty(
27 kChildWindowVisibilityChangesAnimatedKey)) || 27 kChildWindowVisibilityChangesAnimatedKey)) ||
28 window->GetProperty(kWindowVisibilityChangesAnimatedKey); 28 window->GetProperty(kWindowVisibilityChangesAnimatedKey);
29 } 29 }
30 30
31 } // namespace 31 } // namespace
32 32
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 88
89 void SetWindowVisibilityChangesAnimated(aura::Window* window) { 89 void SetWindowVisibilityChangesAnimated(aura::Window* window) {
90 window->SetProperty(kWindowVisibilityChangesAnimatedKey, true); 90 window->SetProperty(kWindowVisibilityChangesAnimatedKey, true);
91 } 91 }
92 92
93 void SetChildWindowVisibilityChangesAnimated(aura::Window* window) { 93 void SetChildWindowVisibilityChangesAnimated(aura::Window* window) {
94 window->SetProperty(kChildWindowVisibilityChangesAnimatedKey, true); 94 window->SetProperty(kChildWindowVisibilityChangesAnimatedKey, true);
95 } 95 }
96 96
97 } // namespace wm 97 } // namespace wm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698