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

Unified Diff: chrome/renderer/render_view.cc

Issue 6253017: Pepper/Flapper: First pass at context menu implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix mock plugin delegate Created 9 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
Index: chrome/renderer/render_view.cc
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 1e2be189e12e8020a132d90d799b4d82b4a3190c..99ac56259b152bff5ec67cf66adca488d824da9e 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -569,7 +569,9 @@ RenderView::RenderView(RenderThreadBase* render_thread,
device_orientation_dispatcher_(NULL),
accessibility_ack_pending_(false),
pending_app_icon_requests_(0),
- session_storage_namespace_id_(session_storage_namespace_id) {
+ session_storage_namespace_id_(session_storage_namespace_id),
+ has_saved_context_menu_action_(false),
+ saved_context_menu_action_(0) {
#if defined(OS_MACOSX)
// On Mac, the select popups are rendered by the browser.
// Note that we don't do this in RenderMain otherwise this would not be called
@@ -4712,8 +4714,17 @@ void RenderView::OnSetAltErrorPageURL(const GURL& url) {
alternate_error_page_url_ = url;
}
-void RenderView::OnCustomContextMenuAction(unsigned action) {
- webview()->performCustomContextMenuAction(action);
+void RenderView::OnCustomContextMenuAction(
+ const webkit_glue::CustomContextMenuContext& custom_context,
+ unsigned action) {
+ if (custom_context.is_pepper_menu) {
+ // Just save the action.
+ DCHECK(!has_saved_context_menu_action_);
+ has_saved_context_menu_action_ = true;
+ saved_context_menu_action_ = action;
+ } else {
+ webview()->performCustomContextMenuAction(action);
+ }
}
void RenderView::OnTranslatePage(int page_id,
@@ -5770,6 +5781,15 @@ void RenderView::OnJavaScriptStressTestControl(int cmd, int param) {
}
}
-void RenderView::OnContextMenuClosed() {
- context_menu_node_.reset();
+void RenderView::OnContextMenuClosed(
+ const webkit_glue::CustomContextMenuContext& custom_context) {
+ if (custom_context.is_pepper_menu) {
+ pepper_delegate_.CompleteShowContextMenu(custom_context.request_id,
+ has_saved_context_menu_action_,
+ saved_context_menu_action_);
+ has_saved_context_menu_action_ = false;
+ saved_context_menu_action_ = 0;
+ } else {
+ context_menu_node_.reset();
+ }
}
« no previous file with comments | « chrome/renderer/render_view.h ('k') | ppapi/c/pp_errors.h » ('j') | ppapi/c/private/ppb_flash.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698