Index: ash/accelerators/accelerator_controller.cc |
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc |
index 19f3f3fafd9471ad4256ed7e7b508d2801779806..ef9725ba1aba9a4679f69d1df7a12b367e33315a 100644 |
--- a/ash/accelerators/accelerator_controller.cc |
+++ b/ash/accelerators/accelerator_controller.cc |
@@ -61,6 +61,7 @@ |
#include "ui/compositor/layer_animator.h" |
#include "ui/gfx/screen.h" |
#include "ui/oak/oak.h" |
+#include "ui/views/controls/webview/webview.h" |
#include "ui/views/debug_utils.h" |
#include "ui/views/widget/widget.h" |
@@ -96,6 +97,34 @@ void HandleCycleWindowLinear(CycleDirection direction) { |
window_cycle_controller()->HandleLinearCycleWindow(); |
} |
+bool HandleAccessibleFocusCycle(bool reverse) { |
+ if (!Shell::GetInstance()->delegate()->IsSpokenFeedbackEnabled()) |
+ return false; |
+ aura::Window* active_window = ash::wm::GetActiveWindow(); |
+ if (!active_window) |
+ return false; |
+ views::Widget* widget = |
+ views::Widget::GetWidgetForNativeWindow(active_window); |
+ if (!widget) |
+ return false; |
+ views::FocusManager* focus_manager = widget->GetFocusManager(); |
+ if (!focus_manager) |
+ return false; |
+ views::View* view = focus_manager->GetFocusedView(); |
+ if (view->GetClassName() == views::WebView::kViewClassName) |
+ return false; |
+ |
+ focus_manager->AdvanceFocus(reverse); |
+ return true; |
+} |
+ |
+void HandleSilenceSpokenFeedback() { |
+ if (!Shell::GetInstance()->delegate()->IsSpokenFeedbackEnabled()) |
+ return; |
+ |
+ Shell::GetInstance()->delegate()->SilenceSpokenFeedback(); |
+} |
+ |
#if defined(OS_CHROMEOS) |
bool HandleLock() { |
Shell::GetInstance()->session_state_delegate()->LockScreen(); |
@@ -474,6 +503,10 @@ bool AcceleratorController::PerformAction(int action, |
// function might be called *twice*, via BrowserView::PreHandleKeyboardEvent |
// and BrowserView::HandleKeyboardEvent, for a single accelerator press. |
switch (action) { |
+ case ACCESSIBLE_NEXT: |
+ return HandleAccessibleFocusCycle(false); |
+ case ACCESSIBLE_PREVIOUS: |
+ return HandleAccessibleFocusCycle(true); |
case CYCLE_BACKWARD_MRU: |
if (key_code == ui::VKEY_TAB) |
shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_PREVWINDOW_TAB); |
@@ -508,6 +541,9 @@ bool AcceleratorController::PerformAction(int action, |
return HandleFileManager(false /* as_dialog */); |
case OPEN_CROSH: |
return HandleCrosh(); |
+ case SILENCE_SPOKEN_FEEDBACK: |
+ HandleSilenceSpokenFeedback(); |
+ break; |
case SWAP_PRIMARY_DISPLAY: |
Shell::GetInstance()->display_controller()->SwapPrimaryDisplay(); |
return true; |