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

Unified Diff: ash/wm/ash_activation_controller.cc

Issue 11451002: Focus launcher if spoken feedback is enabled and no other windows visible. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleaned up the code. Created 8 years 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 | « ash/launcher/launcher.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ash/launcher/launcher.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698