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

Unified Diff: chrome/browser/renderer_host/render_widget_host_view_mac.mm

Issue 549212: Merge 37417 - [Mac] Prevent scriptinitiated tab close while a content select ... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/307/src/
Patch Set: Created 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_host/render_widget_host_view_mac.mm
===================================================================
--- chrome/browser/renderer_host/render_widget_host_view_mac.mm (revision 37545)
+++ chrome/browser/renderer_host/render_widget_host_view_mac.mm (working copy)
@@ -4,6 +4,7 @@
#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
+#import "base/chrome_application_mac.h"
#include "base/histogram.h"
#import "base/scoped_nsobject.h"
#include "base/string_util.h"
@@ -414,6 +415,14 @@
{
// Make sure events can be pumped while the menu is up.
MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
+
+ // One of the events that could be pumped is |window.close()|.
+ // User-initiated event-tracking loops protect against this by
+ // setting flags in -[CrApplication sendEvent:], but since
+ // web-content menus are initiated by IPC message the setup has to
+ // be done manually.
+ chrome_application_mac::ScopedSendingEvent sendingEventScoper;
+
// Now run a SYNCHRONOUS NESTED EVENT LOOP until the pop-up is finished.
[menu_runner runMenuInView:parent_view_
withBounds:position
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698