OLD | NEW |
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_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_AURA_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_AURA_H_ |
6 #define UI_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_AURA_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_AURA_H_ |
7 | 7 |
| 8 #include "base/callback.h" |
8 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
9 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
10 #include "ui/views/controls/menu/menu_message_loop.h" | 11 #include "ui/views/controls/menu/menu_message_loop.h" |
11 | 12 |
| 13 namespace base { |
| 14 class MessagePumpDispatcher; |
| 15 } |
| 16 |
12 namespace ui { | 17 namespace ui { |
13 class ScopedEventDispatcher; | 18 class ScopedEventDispatcher; |
14 } | 19 } |
15 | 20 |
16 namespace views { | 21 namespace views { |
17 | 22 |
18 class MenuMessageLoopAura : public MenuMessageLoop { | 23 class MenuMessageLoopAura : public MenuMessageLoop { |
19 public: | 24 public: |
20 MenuMessageLoopAura(); | 25 MenuMessageLoopAura(); |
21 virtual ~MenuMessageLoopAura(); | 26 virtual ~MenuMessageLoopAura(); |
22 | 27 |
23 // Overridden from MenuMessageLoop: | 28 // Overridden from MenuMessageLoop: |
24 virtual void Run(MenuController* controller, | 29 virtual void Run(MenuController* controller, |
25 Widget* owner, | 30 Widget* owner, |
26 bool nested_menu) OVERRIDE; | 31 bool nested_menu) OVERRIDE; |
27 virtual bool ShouldQuitNow() const OVERRIDE; | 32 virtual bool ShouldQuitNow() const OVERRIDE; |
28 virtual void QuitNow() OVERRIDE; | 33 virtual void QuitNow() OVERRIDE; |
29 virtual void RepostEventToWindow(const ui::LocatedEvent& event, | 34 virtual void RepostEventToWindow(const ui::LocatedEvent& event, |
30 gfx::NativeWindow window, | 35 gfx::NativeWindow window, |
31 const gfx::Point& screen_loc) OVERRIDE; | 36 const gfx::Point& screen_loc) OVERRIDE; |
32 virtual void ClearOwner() OVERRIDE; | 37 virtual void ClearOwner() OVERRIDE; |
33 | 38 |
34 private: | 39 private: |
35 // Owner of child windows. | 40 // Owner of child windows. |
36 // WARNING: this may be NULL. | 41 // WARNING: this may be NULL. |
37 Widget* owner_; | 42 Widget* owner_; |
38 | 43 |
39 scoped_ptr<ui::ScopedEventDispatcher> nested_dispatcher_; | 44 scoped_ptr<ui::ScopedEventDispatcher> nested_dispatcher_; |
| 45 base::Closure message_loop_quit_; |
40 | 46 |
41 DISALLOW_COPY_AND_ASSIGN(MenuMessageLoopAura); | 47 DISALLOW_COPY_AND_ASSIGN(MenuMessageLoopAura); |
42 }; | 48 }; |
43 | 49 |
44 } // namespace views | 50 } // namespace views |
45 | 51 |
46 #endif // UI_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_AURA_H_ | 52 #endif // UI_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_AURA_H_ |
OLD | NEW |