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

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

Issue 1565013002: Don't send touch events to windows like menus when the touch occurs outside the menu bounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Restore DCHECK Created 4 years, 11 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 #include "ui/views/controls/menu/menu_message_loop_mac.h" 5 #include "ui/views/controls/menu/menu_message_loop_mac.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
11 #include "ui/gfx/geometry/point.h" 11 #include "ui/gfx/geometry/point.h"
12 12
13 namespace views { 13 namespace views {
14 14
15 // static 15 // static
16 MenuMessageLoop* MenuMessageLoop::Create() { 16 MenuMessageLoop* MenuMessageLoop::Create() {
17 return new MenuMessageLoopMac; 17 return new MenuMessageLoopMac;
18 } 18 }
19 19
20 // static 20 // static
21 void MenuMessageLoop::RepostEventToWindow(const ui::LocatedEvent& event, 21 void MenuMessageLoop::RepostEventToWindow(const ui::LocatedEvent* event,
22 gfx::NativeWindow window, 22 gfx::NativeWindow window,
23 const gfx::Point& screen_loc) { 23 const gfx::Point& screen_loc) {
24 NOTIMPLEMENTED(); 24 NOTIMPLEMENTED();
25 } 25 }
26 26
27 MenuMessageLoopMac::MenuMessageLoopMac() {} 27 MenuMessageLoopMac::MenuMessageLoopMac() {}
28 28
29 MenuMessageLoopMac::~MenuMessageLoopMac() {} 29 MenuMessageLoopMac::~MenuMessageLoopMac() {}
30 30
31 void MenuMessageLoopMac::Run(MenuController* controller, 31 void MenuMessageLoopMac::Run(MenuController* controller,
32 Widget* owner, 32 Widget* owner,
33 bool nested_menu) { 33 bool nested_menu) {
34 base::MessageLoopForUI* loop = base::MessageLoopForUI::current(); 34 base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
35 base::MessageLoop::ScopedNestableTaskAllower allow(loop); 35 base::MessageLoop::ScopedNestableTaskAllower allow(loop);
36 base::RunLoop run_loop; 36 base::RunLoop run_loop;
37 base::AutoReset<base::RunLoop*> reset_run_loop(&run_loop_, &run_loop); 37 base::AutoReset<base::RunLoop*> reset_run_loop(&run_loop_, &run_loop);
38 run_loop.Run(); 38 run_loop.Run();
39 } 39 }
40 40
41 void MenuMessageLoopMac::QuitNow() { 41 void MenuMessageLoopMac::QuitNow() {
42 DCHECK(run_loop_); 42 DCHECK(run_loop_);
43 run_loop_->Quit(); 43 run_loop_->Quit();
44 } 44 }
45 45
46 void MenuMessageLoopMac::ClearOwner() { 46 void MenuMessageLoopMac::ClearOwner() {
47 } 47 }
48 48
49 } // namespace views 49 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698