Index: ui/views/corewm/window_util.cc |
=================================================================== |
--- ui/views/corewm/window_util.cc (revision 170295) |
+++ ui/views/corewm/window_util.cc (working copy) |
@@ -4,12 +4,52 @@ |
#include "ui/views/corewm/window_util.h" |
+#include "ui/aura/client/activation_client.h" |
+#include "ui/aura/root_window.h" |
#include "ui/aura/window.h" |
#include "ui/compositor/layer.h" |
namespace views { |
namespace corewm { |
+void ActivateWindow(aura::Window* window) { |
+ DCHECK(window); |
+ DCHECK(window->GetRootWindow()); |
+ aura::client::GetActivationClient(window->GetRootWindow())->ActivateWindow( |
+ window); |
+} |
+ |
+void DeactivateWindow(aura::Window* window) { |
+ DCHECK(window); |
+ DCHECK(window->GetRootWindow()); |
+ aura::client::GetActivationClient(window->GetRootWindow())->DeactivateWindow( |
+ window); |
+} |
+ |
+bool IsActiveWindow(aura::Window* window) { |
+ DCHECK(window); |
+ if (!window->GetRootWindow()) |
+ return false; |
+ aura::client::ActivationClient* client = |
+ aura::client::GetActivationClient(window->GetRootWindow()); |
+ return client && client->GetActiveWindow() == window; |
+} |
+ |
+bool CanActivateWindow(aura::Window* window) { |
+ DCHECK(window); |
+ if (!window->GetRootWindow()) |
+ return false; |
+ aura::client::ActivationClient* client = |
+ aura::client::GetActivationClient(window->GetRootWindow()); |
+ return client && client->CanActivateWindow(window); |
+} |
+ |
+aura::Window* GetActivatableWindow(aura::Window* window) { |
+ aura::client::ActivationClient* client = |
+ aura::client::GetActivationClient(window->GetRootWindow()); |
+ return client ? client->GetActivatableWindow(window) : NULL; |
+} |
+ |
void DeepDeleteLayers(ui::Layer* layer) { |
std::vector<ui::Layer*> children = layer->children(); |
for (std::vector<ui::Layer*>::const_iterator it = children.begin(); |