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

Unified Diff: ash/accelerators/accelerator_controller.cc

Issue 77453013: Add an accessibility alert for incorrect use of some accelerators. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix nits Created 7 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 | « ash/accelerators/accelerator_controller.h ('k') | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/accelerators/accelerator_controller.cc
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index f761acb721e26ca11f9439431a32ed91097fc1cf..2e8d4b7ff35c2aa118d78a93b94d236f833a9218 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -44,6 +44,7 @@
#include "ash/system/web_notification/web_notification_tray.h"
#include "ash/touch/touch_hud_debug.h"
#include "ash/volume_control_delegate.h"
+#include "ash/wm/mru_window_tracker.h"
#include "ash/wm/overview/window_selector_controller.h"
#include "ash/wm/partial_screenshot_view.h"
#include "ash/wm/power_button_controller.h"
@@ -436,6 +437,8 @@ void AcceleratorController::Init() {
nonrepeatable_actions_.insert(kNonrepeatableActions[i]);
for (size_t i = 0; i < kActionsAllowedInAppModeLength; ++i)
actions_allowed_in_app_mode_.insert(kActionsAllowedInAppMode[i]);
+ for (size_t i = 0; i < kActionsNeedingWindowLength; ++i)
+ actions_needing_window_.insert(kActionsNeedingWindow[i]);
RegisterAccelerators(kAcceleratorData, kAcceleratorDataLength);
@@ -524,6 +527,12 @@ bool AcceleratorController::PerformAction(int action,
actions_allowed_in_app_mode_.end()) {
return false;
}
+ if (MruWindowTracker::BuildWindowList(false).empty() &&
+ actions_needing_window_.find(action) != actions_needing_window_.end()) {
+ Shell::GetInstance()->accessibility_delegate()->TriggerAccessibilityAlert(
+ A11Y_ALERT_WINDOW_NEEDED);
+ return true;
+ }
const ui::KeyboardCode key_code = accelerator.key_code();
// PerformAction() is performed from gesture controllers and passes
« no previous file with comments | « ash/accelerators/accelerator_controller.h ('k') | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698