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

Side by Side Diff: ui/views/controls/menu/menu_message_loop_mac.cc

Issue 2772863002: Delete MenuController Nested Message Loop (Closed)
Patch Set: remove another async flag Created 3 years, 9 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
(Empty)
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 "ui/views/controls/menu/menu_message_loop_mac.h"
6
7 #include "base/auto_reset.h"
8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h"
11 #include "ui/gfx/geometry/point.h"
12
13 namespace views {
14
15 // static
16 MenuMessageLoop* MenuMessageLoop::Create() {
17 return new MenuMessageLoopMac;
18 }
19
20 // static
21 void MenuMessageLoop::RepostEventToWindow(const ui::LocatedEvent* event,
22 gfx::NativeWindow window,
23 const gfx::Point& screen_loc) {
24 NOTIMPLEMENTED();
25 }
26
27 MenuMessageLoopMac::MenuMessageLoopMac() {}
28
29 MenuMessageLoopMac::~MenuMessageLoopMac() {}
30
31 void MenuMessageLoopMac::Run() {
32 base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
33 base::MessageLoop::ScopedNestableTaskAllower allow(loop);
34 base::RunLoop run_loop;
35 base::AutoReset<base::RunLoop*> reset_run_loop(&run_loop_, &run_loop);
36 run_loop.Run();
37 }
38
39 void MenuMessageLoopMac::QuitNow() {
40 DCHECK(run_loop_);
41 run_loop_->Quit();
42 }
43
44 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_message_loop_mac.h ('k') | ui/views/controls/menu/menu_runner_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698