Chromium Code Reviews| Index: ash/wm/ash_activation_controller.cc |
| diff --git a/ash/wm/ash_activation_controller.cc b/ash/wm/ash_activation_controller.cc |
| index f9cc006b0fef9804fbdb0462a08ad4620ddbfa37..98d29d22e0e1e0852bc5b24cdd24c80d5184b00b 100644 |
| --- a/ash/wm/ash_activation_controller.cc |
| +++ b/ash/wm/ash_activation_controller.cc |
| @@ -4,13 +4,16 @@ |
| #include "ash/wm/ash_activation_controller.h" |
| +#include "ash/launcher/launcher.h" |
| #include "ash/root_window_controller.h" |
| #include "ash/shell.h" |
| +#include "ash/shell_delegate.h" |
| #include "ash/wm/activation_controller.h" |
| #include "ash/wm/property_util.h" |
| #include "ash/wm/window_util.h" |
| #include "ash/wm/workspace_controller.h" |
| #include "ui/views/corewm/window_modality_controller.h" |
| +#include "ui/views/widget/widget.h" |
| namespace ash { |
| namespace internal { |
| @@ -34,6 +37,25 @@ aura::Window* AshActivationController::WillActivateWindow( |
| if (window_modal_transient) |
| return window_modal_transient; |
| + // We want to allow to activate launcher only when invoked by focus cycler |
| + // or as a fallback while Spoken feedback is enabled and no other windows |
| + // on the screen are activeable. |
| + Launcher* launcher; |
|
sky
2012/12/05 05:01:09
Can we do all this if window is null and move to a
mtomasz
2012/12/07 06:18:47
Done.
|
| + if (Shell::IsLauncherPerDisplayEnabled()) { |
| + launcher = GetRootWindowController( |
| + Shell::GetActiveRootWindow())->launcher(); |
| + } else { |
| + launcher = Launcher::ForPrimaryDisplay(); |
| + } |
| + if (launcher) { |
| + aura::Window* launcher_window = launcher->widget()->GetNativeWindow(); |
| + if (window == NULL) { |
| + // Fallback to launcher when Spoken feedback is enabled. |
| + launcher->WillActivateAsFallback(); |
| + window = launcher_window; |
| + } |
| + } |
| + |
| // Make sure the workspace manager switches to the workspace for window. |
| // Without this CanReceiveEvents() below returns false and activation never |
| // changes. CanReceiveEvents() returns false if |window| isn't in the active |