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
3 // found in the LICENSE file.
5 #ifndef UI_WM_CORE_NESTED_ACCELERATOR_DISPATCHER_H_
6 #define UI_WM_CORE_NESTED_ACCELERATOR_DISPATCHER_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "ui/wm/wm_export.h"
13 class MessagePumpDispatcher
;
23 class NestedAcceleratorDelegate
;
25 // Dispatcher for handling accelerators from menu.
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
{
34 virtual ~NestedAcceleratorDispatcher();
36 static scoped_ptr
<NestedAcceleratorDispatcher
> Create(
37 NestedAcceleratorDelegate
* dispatcher_delegate
,
38 base::MessagePumpDispatcher
* nested_dispatcher
);
40 // Creates a base::RunLoop object to run a nested message loop.
41 virtual scoped_ptr
<base::RunLoop
> CreateRunLoop() = 0;
44 explicit NestedAcceleratorDispatcher(NestedAcceleratorDelegate
* delegate
);
46 NestedAcceleratorDelegate
*
47 delegate_
; // Owned by NestedAcceleratorController.
50 DISALLOW_COPY_AND_ASSIGN(NestedAcceleratorDispatcher
);
55 #endif // UI_WM_CORE_NESTED_ACCELERATOR_DISPATCHER_H_