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

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

Issue 555144: [Mac] Prevent script-initiated tab close while a content select menu is up. (Closed)
Patch Set: Comment wordsmithing. 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
diff --git a/chrome/browser/renderer_host/render_widget_host_view_mac.mm b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
index 9eb46a8d3fd3b1fbdb071397be5da66f39cd2b6e..004e3daf663a2be65604a5561d696d0f3f0383e3 100644
--- a/chrome/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/chrome/browser/renderer_host/render_widget_host_view_mac.mm
@@ -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"
@@ -407,6 +408,14 @@ void RenderWidgetHostViewMac::ShowPopupWithItems(
{
// 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;
+
[menu_runner runMenuInView:parent_view_
withBounds:position
initialIndex:selected_item];
« 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