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

Side by Side Diff: ui/wm/core/nested_accelerator_delegate.h

Issue 312483002: More accelerator code leanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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 #ifndef UI_WM_CORE_NESTED_ACCELERATOR_DELEGATE_H_ 5 #ifndef UI_WM_CORE_NESTED_ACCELERATOR_DELEGATE_H_
6 #define UI_WM_CORE_NESTED_ACCELERATOR_DELEGATE_H_ 6 #define UI_WM_CORE_NESTED_ACCELERATOR_DELEGATE_H_
7 7
8 namespace ui { 8 namespace ui {
9 class KeyEvent; 9 class Accelerator;
10 } 10 }
11 11
12 namespace wm { 12 namespace wm {
13 13
14 // A delegate interface that implements the behavior of nested accelerator 14 // A delegate interface that implements the behavior of nested accelerator
15 // handling. 15 // handling.
16 class NestedAcceleratorDelegate { 16 class NestedAcceleratorDelegate {
17 public: 17 public:
18 enum Result {
19 RESULT_PROCESSED,
20 RESULT_NOT_PROCESSED,
21 // The key event should be ignored now and instead be reposted so that
22 // next event loop.
23 RESULT_PROCESS_LATER,
24 };
25
18 virtual ~NestedAcceleratorDelegate() {} 26 virtual ~NestedAcceleratorDelegate() {}
19 27
20 // If the key event should be ignored now and instead be reposted so that next 28 // Attempts to process the |accelerator|.
21 // event loop. 29 virtual Result ProcessAccelerator(const ui::Accelerator& accelerator) = 0;
22 virtual bool ShouldProcessEventNow(const ui::KeyEvent& key_event) = 0;
23
24 // Attempts to process an accelerator for the key-event.
25 // Returns whether an accelerator was triggered and processed.
26 virtual bool ProcessEvent(const ui::KeyEvent& key_event) = 0;
27 }; 30 };
28 31
29 } // namespace wm 32 } // namespace wm
30 33
31 #endif // UI_WM_CORE_NESTED_ACCELERATOR_DELEGATE_H_ 34 #endif // UI_WM_CORE_NESTED_ACCELERATOR_DELEGATE_H_
OLDNEW
« no previous file with comments | « ui/wm/core/nested_accelerator_controller_unittest.cc ('k') | ui/wm/core/nested_accelerator_dispatcher_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698