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.
5 #include "ui/views/controls/menu/menu_message_loop_mac.h"
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"
16 MenuMessageLoop
* MenuMessageLoop::Create() {
17 return new MenuMessageLoopMac
;
20 MenuMessageLoopMac::MenuMessageLoopMac() {
23 MenuMessageLoopMac::~MenuMessageLoopMac() {
26 void MenuMessageLoopMac::RepostEventToWindow(const ui::LocatedEvent
& event
,
27 gfx::NativeWindow window
,
28 const gfx::Point
& screen_loc
) {
32 void MenuMessageLoopMac::Run(MenuController
* controller
,
35 base::MessageLoopForUI
* loop
= base::MessageLoopForUI::current();
36 base::MessageLoop::ScopedNestableTaskAllower
allow(loop
);
37 base::RunLoop run_loop
;
38 base::AutoReset
<base::RunLoop
*> reset_run_loop(&run_loop_
, &run_loop
);
42 void MenuMessageLoopMac::QuitNow() {
47 void MenuMessageLoopMac::ClearOwner() {