| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/nested_accelerator_delegate.h" | 5 #include "ash/accelerators/nested_accelerator_delegate.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ui/aura/window_event_dispatcher.h" | 9 #include "ui/aura/window_event_dispatcher.h" |
| 10 #include "ui/base/accelerators/accelerator.h" | 10 #include "ui/base/accelerators/accelerator.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 NestedAcceleratorDelegate::Result NestedAcceleratorDelegate::ProcessAccelerator( | 56 NestedAcceleratorDelegate::Result NestedAcceleratorDelegate::ProcessAccelerator( |
| 57 const ui::Accelerator& accelerator) { | 57 const ui::Accelerator& accelerator) { |
| 58 if (!ShouldProcessAcceleratorNow(accelerator)) | 58 if (!ShouldProcessAcceleratorNow(accelerator)) |
| 59 return RESULT_PROCESS_LATER; | 59 return RESULT_PROCESS_LATER; |
| 60 | 60 |
| 61 ash::AcceleratorController* accelerator_controller = | 61 ash::AcceleratorController* accelerator_controller = |
| 62 ash::Shell::GetInstance()->accelerator_controller(); | 62 ash::Shell::GetInstance()->accelerator_controller(); |
| 63 if (!accelerator_controller) | 63 if (!accelerator_controller) |
| 64 return RESULT_NOT_PROCESSED; | 64 return RESULT_NOT_PROCESSED; |
| 65 | |
| 66 // Fill out context object so AcceleratorController will know what | |
| 67 // was the previous accelerator or if the current accelerator is repeated. | |
| 68 Shell::GetInstance()->accelerator_controller()->context()->UpdateContext( | |
| 69 accelerator); | |
| 70 return accelerator_controller->Process(accelerator) ? RESULT_PROCESSED | 65 return accelerator_controller->Process(accelerator) ? RESULT_PROCESSED |
| 71 : RESULT_NOT_PROCESSED; | 66 : RESULT_NOT_PROCESSED; |
| 72 } | 67 } |
| 73 | 68 |
| 74 } // namespace ash | 69 } // namespace ash |
| OLD | NEW |