| Index: chrome/browser/tab_contents/render_view_context_menu.cc
|
| ===================================================================
|
| --- chrome/browser/tab_contents/render_view_context_menu.cc (revision 70859)
|
| +++ chrome/browser/tab_contents/render_view_context_menu.cc (working copy)
|
| @@ -399,6 +399,9 @@
|
| case WebContextMenuData::MediaTypeAudio:
|
| AppendAudioItems();
|
| break;
|
| + case WebContextMenuData::MediaTypePlugin:
|
| + AppendPluginItems();
|
| + break;
|
| }
|
|
|
| if (params_.is_editable)
|
| @@ -524,6 +527,18 @@
|
| IDS_CONTENT_CONTEXT_CONTROLS);
|
| }
|
|
|
| +void RenderViewContextMenu::AppendPluginItems() {
|
| + if (params_.page_url == params_.src_url) {
|
| + // Full page plugin, so show page menu items.
|
| + if (params_.link_url.is_empty() && params_.selection_text.empty())
|
| + AppendPageItems();
|
| + } else {
|
| + menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_SAVEAVAS,
|
| + IDS_CONTENT_CONTEXT_SAVEPAGEAS);
|
| + menu_model_.AddItemWithStringId(IDC_PRINT, IDS_CONTENT_CONTEXT_PRINT);
|
| + }
|
| +}
|
| +
|
| void RenderViewContextMenu::AppendPageItems() {
|
| menu_model_.AddItemWithStringId(IDC_BACK, IDS_CONTENT_CONTEXT_BACK);
|
| menu_model_.AddItemWithStringId(IDC_FORWARD, IDS_CONTENT_CONTEXT_FORWARD);
|
| @@ -935,6 +950,9 @@
|
| return !params_.misspelled_word.empty();
|
|
|
| case IDC_PRINT:
|
| + return params_.media_type == WebContextMenuData::MediaTypeNone ||
|
| + params_.media_flags & WebContextMenuData::MediaCanPrint;
|
| +
|
| case IDC_CONTENT_CONTEXT_SEARCHWEBFOR:
|
| case IDC_CONTENT_CONTEXT_GOTOURL:
|
| case IDC_SPELLCHECK_SUGGESTION_0:
|
| @@ -1212,7 +1230,11 @@
|
| break;
|
|
|
| case IDC_PRINT:
|
| - source_tab_contents_->PrintPreview();
|
| + if (params_.media_type == WebContextMenuData::MediaTypeNone) {
|
| + source_tab_contents_->PrintPreview();
|
| + } else {
|
| + source_tab_contents_->render_view_host()->PrintNodeUnderContextMenu();
|
| + }
|
| break;
|
|
|
| case IDC_VIEW_SOURCE:
|
| @@ -1376,6 +1398,10 @@
|
| }
|
| }
|
|
|
| +void RenderViewContextMenu::MenuClosed() {
|
| + source_tab_contents_->render_view_host()->ContextMenuClosed();
|
| +}
|
| +
|
| bool RenderViewContextMenu::IsDevCommandEnabled(int id) const {
|
| const CommandLine& command_line = *CommandLine::ForCurrentProcess();
|
| if (command_line.HasSwitch(switches::kAlwaysEnableDevTools))
|
|
|