menu_event_dispatcher_linux.h revision c5cede9ae108bb15f6b7a8aea21c7e1fefa2834c
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.
4
5#include "base/macros.h"
6#include "ui/events/platform/platform_event_dispatcher.h"
7
8namespace views {
9
10class MenuController;
11
12namespace internal {
13
14// A message-pump dispatcher object used to dispatch events from the nested
15// message-loop initiated by the MenuController.
16class MenuEventDispatcher : public ui::PlatformEventDispatcher {
17 public:
18  explicit MenuEventDispatcher(MenuController* menu_controller);
19  virtual ~MenuEventDispatcher();
20
21 private:
22  // ui::PlatformEventDispatcher:
23  virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
24  virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE;
25
26  MenuController* menu_controller_;
27
28  DISALLOW_COPY_AND_ASSIGN(MenuEventDispatcher);
29};
30
31}  // namespace internal
32}  // namespace views
33