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

Unified Diff: chrome/renderer/render_view.cc

Issue 5639004: Implement a useful context menu for the blocked plug-in frame:... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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 | « chrome/renderer/render_view.h ('k') | webkit/glue/plugins/webview_plugin.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/render_view.cc
===================================================================
--- chrome/renderer/render_view.cc (revision 67601)
+++ chrome/renderer/render_view.cc (working copy)
@@ -517,7 +517,8 @@
accessibility_ack_pending_(false),
pending_app_icon_requests_(0),
session_storage_namespace_id_(session_storage_namespace_id),
- decrement_shared_popup_at_destruction_(false) {
+ decrement_shared_popup_at_destruction_(false),
+ custom_menu_listener_(NULL) {
#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
@@ -807,6 +808,15 @@
return CreateNPAPIPlugin(frame, params, info.path, mime_type);
}
+void RenderView::CustomMenuListenerInstall(CustomMenuListener* listening) {
+ custom_menu_listener_ = listening;
+}
+
+void RenderView::CustomMenuListenerDestroyed(CustomMenuListener* dead) {
+ if (custom_menu_listener_ == dead)
+ custom_menu_listener_ = NULL;
+}
+
void RenderView::RegisterPluginDelegate(WebPluginDelegateProxy* delegate) {
plugin_delegates_.insert(delegate);
// If the renderer is visible, set initial visibility and focus state.
@@ -2391,6 +2401,7 @@
void RenderView::showContextMenu(
WebFrame* frame, const WebContextMenuData& data) {
+ custom_menu_listener_ = NULL;
ContextMenuParams params = ContextMenuParams(data);
if (!params.misspelled_word.empty() && RenderThread::current()) {
int misspelled_offset, misspelled_length;
@@ -4690,7 +4701,10 @@
}
void RenderView::OnCustomContextMenuAction(unsigned action) {
- webview()->performCustomContextMenuAction(action);
+ if (custom_menu_listener_)
+ custom_menu_listener_->MenuItemSelected(action);
+ else
+ webview()->performCustomContextMenuAction(action);
}
void RenderView::OnTranslatePage(int page_id,
« no previous file with comments | « chrome/renderer/render_view.h ('k') | webkit/glue/plugins/webview_plugin.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698