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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/menu/menu_message_loop_mac.cc
diff --git a/ui/views/controls/menu/menu_message_loop_mac.cc b/ui/views/controls/menu/menu_message_loop_mac.cc
new file mode 100644
index 0000000000000000000000000000000000000000..119c05a24d290c704fe98069b5aad226cf80b40c
--- /dev/null
+++ b/ui/views/controls/menu/menu_message_loop_mac.cc
@@ -0,0 +1,53 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/views/controls/menu/menu_message_loop_mac.h"
+
+#include "base/message_loop/message_loop.h"
+#include "base/run_loop.h"
+
+namespace views {
+
+// static
+MenuMessageLoop* MenuMessageLoop::Create() {
+ return new MenuMessageLoopMac;
+}
+
+MenuMessageLoopMac::MenuMessageLoopMac() {}
tapted 2014/05/09 03:07:58 message_loop_depth_ needs an initializer
Andre 2014/05/09 04:08:47 Done.
+
+MenuMessageLoopMac::~MenuMessageLoopMac() {}
+
+void MenuMessageLoopMac::RepostEventToWindow(const ui::LocatedEvent& event,
+ gfx::NativeWindow window,
+ gfx::Point screen_loc) OVERRIDE;
+ NOTIMPLEMENTED();
+}
+
+void MenuMessageLoopMac::Run(MenuController* controller,
+ Widget* owner,
+ bool nested_menu) {
+ message_loop_depth_++;
+ DCHECK_LE(mesage_loop_depth_, 2);
+
+ base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
+ base::MessageLoop::ScopedNestableTaskAllower allow(loop);
+ base::RunLoop run_loop;
+ run_loop.Run();
+
+ message_loop_depth_--;
+}
+
+bool MenuMessageLoopMac::ShouldQuitNow() const {
+ return true;
+}
+
+void MenuMessageLoopMac::QuitNow() {
+ base::MessageLoop::current()->QuitNow();
+}
+
+int MenuMessageLoopMac::message_loop_depth() const OVERRIDE {
+ return message_loop_depth_;
+}
+
+} // namespace views
« 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