Index: content/browser/renderer_host/render_view_host_impl.cc |
diff --git a/content/browser/renderer_host/render_view_host_impl.cc b/content/browser/renderer_host/render_view_host_impl.cc |
index 8ad9eed96fd9ff9ef88adc439dd0f1abf79621b1..ea9d490779c65690d88be49da3e7fb21a1e2efb1 100644 |
--- a/content/browser/renderer_host/render_view_host_impl.cc |
+++ b/content/browser/renderer_host/render_view_host_impl.cc |
@@ -53,6 +53,7 @@ |
#include "content/public/common/content_constants.h" |
#include "content/public/common/content_switches.h" |
#include "content/public/common/context_menu_params.h" |
+#include "content/public/common/context_menu_event_type.h" |
#include "content/public/common/result_codes.h" |
#include "content/public/common/url_constants.h" |
#include "net/base/net_util.h" |
@@ -1241,7 +1242,16 @@ void RenderViewHostImpl::OnMsgContextMenu( |
FilterURL(policy, renderer_id, false, &validated_params.page_url); |
FilterURL(policy, renderer_id, true, &validated_params.frame_url); |
- delegate_->ShowContextMenu(validated_params); |
+ content::ContextMenuEventType type = content::NO_CONTEXT_MENU; |
sky
2012/09/05 23:57:00
When can we hit this?
varunjain
2012/09/06 03:49:55
I included this to represent the case where javasc
|
+ DCHECK(!in_process_event_types_.empty()); |
+ WebKit::WebInputEvent::Type event_type = in_process_event_types_.front(); |
+ if (WebKit::WebInputEvent::isMouseEventType(event_type)) |
+ type = content::MOUSE_CONTEXT_MENU; |
+ else if (WebKit::WebInputEvent::isGestureEventType(event_type)) |
+ type = content::GESTURE_CONTEXT_MENU; |
+ else if (WebKit::WebInputEvent::isKeyboardEventType(event_type)) |
+ type = content::KEYBOARD_CONTEXT_MENU; |
+ delegate_->ShowContextMenu(validated_params, type); |
} |
void RenderViewHostImpl::OnMsgToggleFullscreen(bool enter_fullscreen) { |