| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_table.h" | 7 #include "ash/accelerators/accelerator_table.h" |
| 8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
| 9 #include "ash/caps_lock_delegate.h" | 9 #include "ash/caps_lock_delegate.h" |
| 10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "ash/volume_control_delegate.h" | 25 #include "ash/volume_control_delegate.h" |
| 26 #include "ash/wm/property_util.h" | 26 #include "ash/wm/property_util.h" |
| 27 #include "ash/wm/window_cycle_controller.h" | 27 #include "ash/wm/window_cycle_controller.h" |
| 28 #include "ash/wm/window_util.h" | 28 #include "ash/wm/window_util.h" |
| 29 #include "ash/wm/workspace/snap_sizer.h" | 29 #include "ash/wm/workspace/snap_sizer.h" |
| 30 #include "base/command_line.h" | 30 #include "base/command_line.h" |
| 31 #include "ui/aura/event.h" | 31 #include "ui/aura/event.h" |
| 32 #include "ui/aura/root_window.h" | 32 #include "ui/aura/root_window.h" |
| 33 #include "ui/base/accelerators/accelerator.h" | 33 #include "ui/base/accelerators/accelerator.h" |
| 34 #include "ui/base/accelerators/accelerator_manager.h" | 34 #include "ui/base/accelerators/accelerator_manager.h" |
| 35 #include "ui/base/keycodes/keyboard_codes.h" |
| 35 #include "ui/compositor/debug_utils.h" | 36 #include "ui/compositor/debug_utils.h" |
| 36 #include "ui/compositor/layer.h" | 37 #include "ui/compositor/layer.h" |
| 37 #include "ui/compositor/layer_animation_sequence.h" | 38 #include "ui/compositor/layer_animation_sequence.h" |
| 38 #include "ui/compositor/layer_animator.h" | 39 #include "ui/compositor/layer_animator.h" |
| 39 #include "ui/compositor/screen_rotation.h" | 40 #include "ui/compositor/screen_rotation.h" |
| 40 #include "ui/oak/oak.h" | 41 #include "ui/oak/oak.h" |
| 41 | 42 |
| 42 #if defined(OS_CHROMEOS) | 43 #if defined(OS_CHROMEOS) |
| 43 #include "chromeos/monitor/output_configurator.h" | 44 #include "chromeos/monitor/output_configurator.h" |
| 44 #endif // defined(OS_CHROMEOS) | 45 #endif // defined(OS_CHROMEOS) |
| (...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 // Return true to prevent propagation of the key event. | 353 // Return true to prevent propagation of the key event. |
| 353 return true; | 354 return true; |
| 354 case TAKE_PARTIAL_SCREENSHOT: | 355 case TAKE_PARTIAL_SCREENSHOT: |
| 355 if (screenshot_delegate_.get()) | 356 if (screenshot_delegate_.get()) |
| 356 ash::Shell::GetInstance()->delegate()-> | 357 ash::Shell::GetInstance()->delegate()-> |
| 357 StartPartialScreenshot(screenshot_delegate_.get()); | 358 StartPartialScreenshot(screenshot_delegate_.get()); |
| 358 // Return true to prevent propagation of the key event because | 359 // Return true to prevent propagation of the key event because |
| 359 // this key combination is reserved for partial screenshot. | 360 // this key combination is reserved for partial screenshot. |
| 360 return true; | 361 return true; |
| 361 case TOGGLE_APP_LIST: | 362 case TOGGLE_APP_LIST: |
| 363 // When spoken feedback is enabled, we should neither toggle the list nor |
| 364 // consume the key since Search+Shift is one of the shortcuts the a11y |
| 365 // feature uses. crbug.com/132296 |
| 366 DCHECK_EQ(ui::VKEY_LWIN, accelerator.key_code()); |
| 367 if (Shell::GetInstance()->delegate()->IsSpokenFeedbackEnabled()) |
| 368 return false; |
| 362 ash::Shell::GetInstance()->ToggleAppList(); | 369 ash::Shell::GetInstance()->ToggleAppList(); |
| 363 return true; | 370 return true; |
| 364 case TOGGLE_CAPS_LOCK: | 371 case TOGGLE_CAPS_LOCK: |
| 365 if (caps_lock_delegate_.get()) | 372 if (caps_lock_delegate_.get()) |
| 366 return caps_lock_delegate_->HandleToggleCapsLock(); | 373 return caps_lock_delegate_->HandleToggleCapsLock(); |
| 367 break; | 374 break; |
| 368 case BRIGHTNESS_DOWN: | 375 case BRIGHTNESS_DOWN: |
| 369 if (brightness_control_delegate_.get()) | 376 if (brightness_control_delegate_.get()) |
| 370 return brightness_control_delegate_->HandleBrightnessDown(accelerator); | 377 return brightness_control_delegate_->HandleBrightnessDown(accelerator); |
| 371 break; | 378 break; |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 // Then set this one as active. | 596 // Then set this one as active. |
| 590 Shell::GetInstance()->launcher()->ActivateLauncherItem(found_index); | 597 Shell::GetInstance()->launcher()->ActivateLauncherItem(found_index); |
| 591 } | 598 } |
| 592 } | 599 } |
| 593 | 600 |
| 594 bool AcceleratorController::CanHandleAccelerators() const { | 601 bool AcceleratorController::CanHandleAccelerators() const { |
| 595 return true; | 602 return true; |
| 596 } | 603 } |
| 597 | 604 |
| 598 } // namespace ash | 605 } // namespace ash |
| OLD | NEW |