Exclude TrayIMETest.PerformActionOnDetailedView under valgrind, where it crashes.
[chromium-blink-merge.git] / ui / wm / core / nested_accelerator_dispatcher.h
blobdf5dd0862d9d4f0d76e1177a19c839f2314948e0
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"
12 namespace base {
13 class MessagePumpDispatcher;
14 class RunLoop;
17 namespace ui {
18 class KeyEvent;
21 namespace wm {
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 {
33 public:
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;
43 protected:
44 explicit NestedAcceleratorDispatcher(NestedAcceleratorDelegate* delegate);
46 NestedAcceleratorDelegate*
47 delegate_; // Owned by NestedAcceleratorController.
49 private:
50 DISALLOW_COPY_AND_ASSIGN(NestedAcceleratorDispatcher);
53 } // namespace wm
55 #endif // UI_WM_CORE_NESTED_ACCELERATOR_DISPATCHER_H_