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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 } |
55 | 55 |
| 56 bool CanActivateWindow(aura::Window* window) { |
| 57 DCHECK(window); |
| 58 if (!window->GetRootWindow()) |
| 59 return false; |
| 60 aura::client::ActivationClient* client = |
| 61 aura::client::GetActivationClient(window->GetRootWindow()); |
| 62 return client && client->CanActivateWindow(window); |
| 63 } |
| 64 |
56 bool IsWindowNormal(aura::Window* window) { | 65 bool IsWindowNormal(aura::Window* window) { |
57 return window->GetProperty(aura::client::kShowStateKey) == | 66 return window->GetProperty(aura::client::kShowStateKey) == |
58 ui::SHOW_STATE_NORMAL || | 67 ui::SHOW_STATE_NORMAL || |
59 window->GetProperty(aura::client::kShowStateKey) == | 68 window->GetProperty(aura::client::kShowStateKey) == |
60 ui::SHOW_STATE_DEFAULT; | 69 ui::SHOW_STATE_DEFAULT; |
61 } | 70 } |
62 | 71 |
63 bool IsWindowMaximized(aura::Window* window) { | 72 bool IsWindowMaximized(aura::Window* window) { |
64 return window->GetProperty(aura::client::kShowStateKey) == | 73 return window->GetProperty(aura::client::kShowStateKey) == |
65 ui::SHOW_STATE_MAXIMIZED; | 74 ui::SHOW_STATE_MAXIMIZED; |
(...skipping 20 matching lines...) Expand all Loading... |
86 void SetOpenWindowSplit(aura::Window* window, bool value) { | 95 void SetOpenWindowSplit(aura::Window* window, bool value) { |
87 window->SetProperty(kOpenWindowSplitKey, value); | 96 window->SetProperty(kOpenWindowSplitKey, value); |
88 } | 97 } |
89 | 98 |
90 bool GetOpenWindowSplit(aura::Window* window) { | 99 bool GetOpenWindowSplit(aura::Window* window) { |
91 return window->GetProperty(kOpenWindowSplitKey); | 100 return window->GetProperty(kOpenWindowSplitKey); |
92 } | 101 } |
93 | 102 |
94 } // namespace wm | 103 } // namespace wm |
95 } // namespace ash | 104 } // namespace ash |
OLD | NEW |