OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_WM_CORE_NESTED_ACCELERATOR_DISPATCHER_H_ | |
6 #define UI_WM_CORE_NESTED_ACCELERATOR_DISPATCHER_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "base/memory/scoped_ptr.h" | |
10 #include "ui/wm/wm_export.h" | |
11 | |
12 namespace base { | |
13 class MessagePumpDispatcher; | |
14 class RunLoop; | |
15 } | |
16 | |
17 namespace ui { | |
18 class KeyEvent; | |
19 } | |
20 | |
21 namespace wm { | |
22 | |
23 class NestedAcceleratorDelegate; | |
24 | |
25 // Dispatcher for handling accelerators from menu. | |
26 // | |
27 // Wraps a nested dispatcher to which control is passed if no accelerator key | |
28 // has been pressed. If the nested dispatcher is NULL, then the control is | |
29 // passed back to the default dispatcher. | |
30 // TODO(pkotwicz): Add support for a |nested_dispatcher| which sends | |
31 // events to a system IME. | |
32 class WM_EXPORT NestedAcceleratorDispatcher { | |
33 public: | |
34 virtual ~NestedAcceleratorDispatcher(); | |
35 | |
36 static scoped_ptr<NestedAcceleratorDispatcher> Create( | |
37 NestedAcceleratorDelegate* dispatcher_delegate, | |
38 base::MessagePumpDispatcher* nested_dispatcher); | |
39 | |
40 // Creates a base::RunLoop object to run a nested message loop. | |
41 virtual scoped_ptr<base::RunLoop> CreateRunLoop() = 0; | |
42 | |
43 protected: | |
44 explicit NestedAcceleratorDispatcher(NestedAcceleratorDelegate* delegate); | |
45 | |
46 NestedAcceleratorDelegate* | |
47 delegate_; // Owned by NestedAcceleratorController. | |
48 | |
49 private: | |
50 DISALLOW_COPY_AND_ASSIGN(NestedAcceleratorDispatcher); | |
51 }; | |
52 | |
53 } // namespace wm | |
54 | |
55 #endif // UI_WM_CORE_NESTED_ACCELERATOR_DISPATCHER_H_ | |
OLD | NEW |