Chromium Code Reviews| Index: ash/common/accelerators/accelerator_controller.cc |
| diff --git a/ash/common/accelerators/accelerator_controller.cc b/ash/common/accelerators/accelerator_controller.cc |
| index ef5c7a35a53c28bbc2c95142087066724dde609d..06233492911adac5de255aed34f51df67fdd24f1 100644 |
| --- a/ash/common/accelerators/accelerator_controller.cc |
| +++ b/ash/common/accelerators/accelerator_controller.cc |
| @@ -33,6 +33,7 @@ |
| #include "base/metrics/user_metrics.h" |
| #include "ui/base/accelerators/accelerator.h" |
| #include "ui/base/accelerators/accelerator_manager.h" |
| +#include "ui/keyboard/keyboard_controller.h" |
| #if defined(OS_CHROMEOS) |
| #include "chromeos/dbus/dbus_thread_manager.h" |
| @@ -924,12 +925,12 @@ bool AcceleratorController::ShouldActionConsumeKeyEvent( |
| AcceleratorController::AcceleratorProcessingRestriction |
| AcceleratorController::GetAcceleratorProcessingRestriction(int action) { |
|
varkha
2016/08/22 20:59:23
Maybe deserves a followup. Is there a good reason
Evan Stade
2016/08/22 21:35:04
dunno, seems tangential to this CL though.
|
| - if (WmShell::Get()->IsPinned() && |
| + WmShell* wm_shell = WmShell::Get(); |
| + if (wm_shell->IsPinned() && |
| actions_allowed_in_pinned_mode_.find(action) == |
| actions_allowed_in_pinned_mode_.end()) { |
| return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; |
| } |
| - WmShell* wm_shell = WmShell::Get(); |
| if (!wm_shell->GetSessionStateDelegate()->IsActiveUserSessionStarted() && |
| actions_allowed_at_login_screen_.find(action) == |
| actions_allowed_at_login_screen_.end()) { |
| @@ -960,6 +961,13 @@ AcceleratorController::GetAcceleratorProcessingRestriction(int action) { |
| A11Y_ALERT_WINDOW_NEEDED); |
| return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; |
| } |
| + // Don't do anything when Alt+Tab comes from a virtual keyboard. Touchscreen |
| + // users have better window switching options. See http://crbug.com/638269 |
| + keyboard::KeyboardController* keyboard_controller = |
| + keyboard::KeyboardController::GetInstance(); |
| + if (keyboard_controller && keyboard_controller->keyboard_visible()) |
| + return RESTRICTION_PREVENT_PROCESSING; |
|
oshima
2016/08/18 23:53:31
This disable alt-tab even if I used the real keybo
varkha
2016/08/22 20:59:23
Maybe we can plumb through a ui::Accelerator param
bshe
2016/08/22 21:02:56
If alt + tab is disabled for VK, it is probably be
Evan Stade
2016/08/22 21:35:04
seems very not worth it. Why is a user using both
Evan Stade
2016/08/22 21:35:04
How would one do that? By special casing to ignore
|
| + |
| return RESTRICTION_NONE; |
| } |