Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Side by Side Diff: ui/views/controls/menu/menu_message_loop_aura.h

Issue 1138523006: Enable keyboard accelerators while a menu is open (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed a bug in restoring the delegate of the parent nested runloop. Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <map>
9 #include <stack>
10
8 #include "base/callback.h" 11 #include "base/callback.h"
9 #include "base/compiler_specific.h" 12 #include "base/compiler_specific.h"
10 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "ui/views/controls/menu/menu_event_filter.h"
11 #include "ui/views/controls/menu/menu_message_loop.h" 15 #include "ui/views/controls/menu/menu_message_loop.h"
12 16
13 namespace base { 17 namespace base {
14 class MessagePumpDispatcher; 18 class MessagePumpDispatcher;
15 } 19 }
16 20
17 namespace ui { 21 namespace ui {
18 class ScopedEventDispatcher; 22 class ScopedEventDispatcher;
19 } 23 }
20 24
(...skipping 12 matching lines...) Expand all
33 void RepostEventToWindow(const ui::LocatedEvent& event, 37 void RepostEventToWindow(const ui::LocatedEvent& event,
34 gfx::NativeWindow window, 38 gfx::NativeWindow window,
35 const gfx::Point& screen_loc) override; 39 const gfx::Point& screen_loc) override;
36 void ClearOwner() override; 40 void ClearOwner() override;
37 41
38 private: 42 private:
39 // Owner of child windows. 43 // Owner of child windows.
40 // WARNING: this may be NULL. 44 // WARNING: this may be NULL.
41 Widget* owner_; 45 Widget* owner_;
42 46
47 scoped_ptr<MenuEventFilter> menu_event_filter_;
48
49 // Maps the IDs of the created nested RunLoops to whether their corresponding
50 // QuitNow() functions have been called or not. This is needed to avoid
51 // calling QuitNow() multiple times while the same Runloop is running until it
52 // actually exits.
53 using RunLoopId = int;
54 std::stack<RunLoopId> run_loop_ids_stack_;
55 std::map<RunLoopId, bool> run_loops_status_;
56
43 base::Closure message_loop_quit_; 57 base::Closure message_loop_quit_;
44 58
45 DISALLOW_COPY_AND_ASSIGN(MenuMessageLoopAura); 59 DISALLOW_COPY_AND_ASSIGN(MenuMessageLoopAura);
46 }; 60 };
47 61
48 } // namespace views 62 } // namespace views
49 63
50 #endif // UI_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_AURA_H_ 64 #endif // UI_VIEWS_CONTROLS_MENU_MENU_MESSAGE_LOOP_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698