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

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

Issue 267593005: Refactor menu controller to isolate aura dependency. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixes for tapted and trybots, plus rebase Created 6 years, 7 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 | Annotate | Revision Log
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/message_loop/message_loop.h"
8 #include "base/run_loop.h"
9
10 namespace views {
11
12 // static
13 MenuMessageLoop* MenuMessageLoop::Create() {
14 return new MenuMessageLoopMac;
15 }
16
17 MenuMessageLoopMac::MenuMessageLoopMac() {}
tapted 2014/05/09 03:07:58 message_loop_depth_ needs an initializer
Andre 2014/05/09 04:08:47 Done.
18
19 MenuMessageLoopMac::~MenuMessageLoopMac() {}
20
21 void MenuMessageLoopMac::RepostEventToWindow(const ui::LocatedEvent& event,
22 gfx::NativeWindow window,
23 gfx::Point screen_loc) OVERRIDE;
24 NOTIMPLEMENTED();
25 }
26
27 void MenuMessageLoopMac::Run(MenuController* controller,
28 Widget* owner,
29 bool nested_menu) {
30 message_loop_depth_++;
31 DCHECK_LE(mesage_loop_depth_, 2);
32
33 base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
34 base::MessageLoop::ScopedNestableTaskAllower allow(loop);
35 base::RunLoop run_loop;
36 run_loop.Run();
37
38 message_loop_depth_--;
39 }
40
41 bool MenuMessageLoopMac::ShouldQuitNow() const {
42 return true;
43 }
44
45 void MenuMessageLoopMac::QuitNow() {
46 base::MessageLoop::current()->QuitNow();
47 }
48
49 int MenuMessageLoopMac::message_loop_depth() const OVERRIDE {
50 return message_loop_depth_;
51 }
52
53 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/controls/menu/menu_message_loop_mac.h ('k') | ui/views/controls/menu/menu_scroll_view_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698