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

Side by Side Diff: ash/accelerators/nested_accelerator_delegate.cc

Issue 308023002: Add EF_IS_REPEAT flag to KeyEvent to handle repeated accelerators correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use ui::EF_IS_REPEAT in test instead Created 6 years, 6 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ash/accelerators/accelerator_delegate.cc ('k') | chrome/browser/chromeos/events/event_rewriter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698