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

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

Issue 2821213002: chromeos: converts ash devtools to aura::Window (Closed)
Patch Set: fix cast Created 3 years, 8 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/window_util.h" 5 #include "ui/wm/core/window_util.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "ui/aura/client/aura_constants.h" 8 #include "ui/aura/client/aura_constants.h"
9 #include "ui/aura/window.h" 9 #include "ui/aura/window.h"
10 #include "ui/compositor/layer.h" 10 #include "ui/compositor/layer.h"
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 window); 60 window);
61 } 61 }
62 62
63 void DeactivateWindow(aura::Window* window) { 63 void DeactivateWindow(aura::Window* window) {
64 DCHECK(window); 64 DCHECK(window);
65 DCHECK(window->GetRootWindow()); 65 DCHECK(window->GetRootWindow());
66 aura::client::GetActivationClient(window->GetRootWindow())->DeactivateWindow( 66 aura::client::GetActivationClient(window->GetRootWindow())->DeactivateWindow(
67 window); 67 window);
68 } 68 }
69 69
70 bool IsActiveWindow(aura::Window* window) { 70 bool IsActiveWindow(const aura::Window* window) {
71 DCHECK(window); 71 DCHECK(window);
72 if (!window->GetRootWindow()) 72 if (!window->GetRootWindow())
73 return false; 73 return false;
74 aura::client::ActivationClient* client = 74 const aura::client::ActivationClient* client =
75 aura::client::GetActivationClient(window->GetRootWindow()); 75 aura::client::GetActivationClient(window->GetRootWindow());
76 return client && client->GetActiveWindow() == window; 76 return client && client->GetActiveWindow() == window;
77 } 77 }
78 78
79 bool CanActivateWindow(aura::Window* window) { 79 bool CanActivateWindow(aura::Window* window) {
80 DCHECK(window); 80 DCHECK(window);
81 if (!window->GetRootWindow()) 81 if (!window->GetRootWindow())
82 return false; 82 return false;
83 aura::client::ActivationClient* client = 83 aura::client::ActivationClient* client =
84 aura::client::GetActivationClient(window->GetRootWindow()); 84 aura::client::GetActivationClient(window->GetRootWindow());
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 bool HasTransientAncestor(const aura::Window* window, 175 bool HasTransientAncestor(const aura::Window* window,
176 const aura::Window* ancestor) { 176 const aura::Window* ancestor) {
177 const aura::Window* transient_parent = GetTransientParent(window); 177 const aura::Window* transient_parent = GetTransientParent(window);
178 if (transient_parent == ancestor) 178 if (transient_parent == ancestor)
179 return true; 179 return true;
180 return transient_parent ? 180 return transient_parent ?
181 HasTransientAncestor(transient_parent, ancestor) : false; 181 HasTransientAncestor(transient_parent, ancestor) : false;
182 } 182 }
183 183
184 } // namespace wm 184 } // namespace wm
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698