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

Unified Diff: ash/wm/activation_controller.cc

Issue 9719037: Aura: Add non-browser windows into the list of "Alt + Tab" cycle list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review fix Created 8 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ash/wm/activation_controller.cc
diff --git a/ash/wm/activation_controller.cc b/ash/wm/activation_controller.cc
index 1d35998d9e7269b007f05244afdc7bdce1e970d0..8995a23730347006245fd4f510d31d34588b7534 100644
--- a/ash/wm/activation_controller.cc
+++ b/ash/wm/activation_controller.cc
@@ -55,6 +55,17 @@ bool SupportsChildActivation(aura::Window* window) {
return false;
}
+bool HasModalTransientChild(aura::Window* window) {
+ aura::Window::Windows::const_iterator it;
+ for (it = window->transient_children().begin();
+ it != window->transient_children().end();
+ ++it) {
+ if ((*it)->GetProperty(aura::client::kModalKey) == ui::MODAL_TYPE_WINDOW)
+ return true;
+ }
+ return false;
+}
+
// Returns true if |window| can be activated or deactivated.
// A window manager typically defines some notion of "top level window" that
// supports activation/deactivation.
@@ -62,8 +73,9 @@ bool CanActivateWindow(aura::Window* window, const aura::Event* event) {
return window &&
window->IsVisible() &&
(!aura::client::GetActivationDelegate(window) ||
- aura::client::GetActivationDelegate(window)->ShouldActivate(event)) &&
- SupportsChildActivation(window->parent());
+ !event ||
sky 2012/03/27 14:59:58 Why are you adding the '!event' clause? It is lega
yoshiki 2012/03/28 15:08:41 Done. Un-changed.
+ aura::client::GetActivationDelegate(window)->ShouldActivate(event)) &&
+ SupportsChildActivation(window->parent());
sky 2012/03/27 14:59:58 fix indentation.
yoshiki 2012/03/28 15:08:41 Done.
}
// When a modal window is activated, we bring its entire transient parent chain
@@ -116,6 +128,10 @@ aura::Window* ActivationController::GetActivatableWindow(
return NULL;
}
+bool ActivationController::CanActivateWindowItself(aura::Window* window) {
+ return CanActivateWindow(window, NULL) && !HasModalTransientChild(window);
+}
+
////////////////////////////////////////////////////////////////////////////////
// ActivationController, aura::client::ActivationClient implementation:

Powered by Google App Engine
This is Rietveld 408576698