| 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/window_util.h" | 5 #include "ash/wm/window_util.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/wm/activation_controller.h" | 8 #include "ash/wm/activation_controller.h" |
| 9 #include "ui/aura/client/activation_client.h" | 9 #include "ui/aura/client/activation_client.h" |
| 10 #include "ui/aura/client/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 DCHECK(window); | 32 DCHECK(window); |
| 33 DCHECK(window->GetRootWindow()); | 33 DCHECK(window->GetRootWindow()); |
| 34 aura::client::GetActivationClient(window->GetRootWindow())->DeactivateWindow( | 34 aura::client::GetActivationClient(window->GetRootWindow())->DeactivateWindow( |
| 35 window); | 35 window); |
| 36 } | 36 } |
| 37 | 37 |
| 38 bool IsActiveWindow(aura::Window* window) { | 38 bool IsActiveWindow(aura::Window* window) { |
| 39 DCHECK(window); | 39 DCHECK(window); |
| 40 if (!window->GetRootWindow()) | 40 if (!window->GetRootWindow()) |
| 41 return false; | 41 return false; |
| 42 | 42 aura::client::ActivationClient* client = |
| 43 return aura::client::GetActivationClient(window->GetRootWindow())-> | 43 aura::client::GetActivationClient(window->GetRootWindow()); |
| 44 GetActiveWindow() == window; | 44 return client && client->GetActiveWindow() == window; |
| 45 } | 45 } |
| 46 | 46 |
| 47 aura::Window* GetActiveWindow() { | 47 aura::Window* GetActiveWindow() { |
| 48 return aura::client::GetActivationClient(Shell::GetRootWindow())-> | 48 return aura::client::GetActivationClient(Shell::GetRootWindow())-> |
| 49 GetActiveWindow(); | 49 GetActiveWindow(); |
| 50 } | 50 } |
| 51 | 51 |
| 52 aura::Window* GetActivatableWindow(aura::Window* window) { | 52 aura::Window* GetActivatableWindow(aura::Window* window) { |
| 53 return internal::ActivationController::GetActivatableWindow(window, NULL); | 53 return internal::ActivationController::GetActivatableWindow(window, NULL); |
| 54 } | 54 } |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 void SetOpenWindowSplit(aura::Window* window, bool value) { | 86 void SetOpenWindowSplit(aura::Window* window, bool value) { |
| 87 window->SetProperty(kOpenWindowSplitKey, value); | 87 window->SetProperty(kOpenWindowSplitKey, value); |
| 88 } | 88 } |
| 89 | 89 |
| 90 bool GetOpenWindowSplit(aura::Window* window) { | 90 bool GetOpenWindowSplit(aura::Window* window) { |
| 91 return window->GetProperty(kOpenWindowSplitKey); | 91 return window->GetProperty(kOpenWindowSplitKey); |
| 92 } | 92 } |
| 93 | 93 |
| 94 } // namespace wm | 94 } // namespace wm |
| 95 } // namespace ash | 95 } // namespace ash |
| OLD | NEW |