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

Unified Diff: ui/views/corewm/window_util.cc

Issue 11418224: Eliminates all ash dependencies from WindowModalityController. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/corewm/window_util.h ('k') | ui/views/widget/desktop_aura/desktop_activation_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
« no previous file with comments | « ui/views/corewm/window_util.h ('k') | ui/views/widget/desktop_aura/desktop_activation_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698