summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 03:23:46 +0000
committerajwong@chromium.org <ajwong@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-17 03:23:46 +0000
commit574a1d691c71e833638ccb1ca395dfa20c6835a4 (patch)
tree1d5f63a520c6b87fd74a19d57e9eaf4737bdd4fc /chrome
parent91cea0e774541297a46197d87e486cf8a4199775 (diff)
downloadchromium_src-574a1d691c71e833638ccb1ca395dfa20c6835a4.zip
chromium_src-574a1d691c71e833638ccb1ca395dfa20c6835a4.tar.gz
chromium_src-574a1d691c71e833638ccb1ca395dfa20c6835a4.tar.bz2
Begin implementation of the context menu for Video and Audio tags.
This code should enable the creation of a basic context menu for the Video and Audio tags. The actions for fullscreen, save screenshot, loop, and set playback rate are not yet implemented. BUG=15686 TEST=None Review URL: http://codereview.chromium.org/149604 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20931 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/app/generated_resources.grd61
-rw-r--r--chrome/browser/renderer_host/render_view_host.cc2
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.cc164
-rw-r--r--chrome/browser/tab_contents/render_view_context_menu.h7
-rw-r--r--chrome/common/render_messages.h22
-rw-r--r--chrome/renderer/render_view.cc6
-rw-r--r--chrome/renderer/render_view.h4
7 files changed, 245 insertions, 21 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index e281eaa..0f39ed2 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -392,6 +392,67 @@ each locale. -->
Open &amp;image in new tab
</message>
+ <message name="IDS_CONTENT_CONTEXT_PLAYBACKRATE_MENU" desc="The text label of the Playback Rate submenu">
+ &amp;Playback Rate
+ </message>
+ <message name="IDS_CONTENT_CONTEXT_PLAYBACKRATE_SLOW" desc="The text label of the 0.5x Speed Playback Rate menu item. The slowest of 5 options.">
+ &amp;Slow (0.5x)
+ </message>
+ <message name="IDS_CONTENT_CONTEXT_PLAYBACKRATE_NORMAL" desc="The text label of the Normal Speed Playback Rate menu item. The default rate of 5 options.">
+ &amp;Normal (1.0x)
+ </message>
+ <message name="IDS_CONTENT_CONTEXT_PLAYBACKRATE_FAST" desc="The text label of the 1.25x Sped Up Playback Rate menu item. The 3rd fastest of 5 options.">
+ &amp;Fast (1.25x)
+ </message>
+ <message name="IDS_CONTENT_CONTEXT_PLAYBACKRATE_FASTER" desc="The text label of the 1.5x Sped Up Playback Rate menu item. The 2nd fastest of 5 options.">
+ F&amp;aster (1.5x)
+ </message>
+ <message name="IDS_CONTENT_CONTEXT_PLAYBACKRATE_DOUBLETIME" desc="The text label of the 2.0x Sped Up Playback Rate menu item. The fastest of 5 options.">
+ D&amp;ouble Time (2.0x)
+ </message>
+
+ <message name="IDS_CONTENT_CONTEXT_LOOP" desc="The name of the Loop command for audio and video playback in the content area context menu">
+ &amp;Loop
+ </message>
+ <message name="IDS_CONTENT_CONTEXT_PLAY" desc="The name of the Play command for audio and video playback in the content area context menu">
+ &amp;Play
+ </message>
+ <message name="IDS_CONTENT_CONTEXT_PAUSE" desc="The name of the Pause command for audio and video playback in the content area context menu">
+ &amp;Pause
+ </message>
+ <message name="IDS_CONTENT_CONTEXT_MUTE" desc="The name of the Mute command for audio and video playback in the content area context menu">
+ &amp;Mute
+ </message>
+ <message name="IDS_CONTENT_CONTEXT_UNMUTE" desc="The name of the Unmute command for audio and video playback in the content area context menu">
+ Un&amp;mute
+ </message>
+
+ <message name="IDS_CONTENT_CONTEXT_FULLSCREEN" desc="The name of the Fullscreen command for the video element in the content area context menu">
+ &amp;Fullscreen
+ </message>
+ <message name="IDS_CONTENT_CONTEXT_SAVESCREENSHOTAS" desc="The name of the Copy Sceenshot As command the video element in the content area context menu">
+ Save &amp;Screenshot...
+ </message>
+ <message name="IDS_CONTENT_CONTEXT_SAVEVIDEOAS" desc="The name of the Save Video As command in the content area context menu">
+ Sa&amp;ve video as...
+ </message>
+ <message name="IDS_CONTENT_CONTEXT_COPYVIDEOLOCATION" desc="The name of the Copy Video Location command in the content area context menu">
+ C&amp;opy video URL
+ </message>
+ <message name="IDS_CONTENT_CONTEXT_OPENVIDEONEWTAB" desc="The name of the Open Video in New Tab command in the content area context menu">
+ &amp;Open video in new tab
+ </message>
+
+ <message name="IDS_CONTENT_CONTEXT_SAVEAUDIOAS" desc="The name of the Save Audio As command in the content area context menu">
+ Sa&amp;ve audio as...
+ </message>
+ <message name="IDS_CONTENT_CONTEXT_COPYAUDIOLOCATION" desc="The name of the Copy Audio Location command in the content area context menu">
+ C&amp;opy audio URL
+ </message>
+ <message name="IDS_CONTENT_CONTEXT_OPENAUDIONEWTAB" desc="The name of the Open Audio in New Tab command in the content area context menu">
+ &amp;Open audio in new tab
+ </message>
+
<message name="IDS_CONTENT_CONTEXT_UNDO" desc="The name of the Undo command in the content area context menu">
&amp;Undo
</message>
diff --git a/chrome/browser/renderer_host/render_view_host.cc b/chrome/browser/renderer_host/render_view_host.cc
index 2f775a5..c788560 100644
--- a/chrome/browser/renderer_host/render_view_host.cc
+++ b/chrome/browser/renderer_host/render_view_host.cc
@@ -1118,7 +1118,7 @@ void RenderViewHost::OnMsgContextMenu(const ContextMenuParams& params) {
// We don't validate |unfiltered_link_url| so that this field can be used
// when users want to copy the original link URL.
FilterURL(policy, renderer_id, &validated_params.link_url);
- FilterURL(policy, renderer_id, &validated_params.image_url);
+ FilterURL(policy, renderer_id, &validated_params.src_url);
FilterURL(policy, renderer_id, &validated_params.page_url);
FilterURL(policy, renderer_id, &validated_params.frame_url);
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc
index a922825..ecc6e5c 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.cc
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -28,6 +28,15 @@
#include "net/base/escape.h"
#include "net/base/net_util.h"
+// Constants for the standard playback rates provided by the context
+// menu. If another rate is reported, it will be considered unknown and
+// no rate will be selected in the submenu.
+static const double kSlowPlaybackRate = 0.5f;
+static const double kNormalPlaybackRate = 1.0f;
+static const double kFastPlaybackRate = 1.25f;
+static const double kFasterPlaybackRate = 1.50f;
+static const double kDoubleTimePlaybackRate = 2.0f;
+
RenderViewContextMenu::RenderViewContextMenu(
TabContents* tab_contents,
const ContextMenuParams& params)
@@ -42,11 +51,12 @@ RenderViewContextMenu::~RenderViewContextMenu() {
// Menu construction functions -------------------------------------------------
void RenderViewContextMenu::Init() {
- InitMenu(params_.node);
+ InitMenu(params_.node, params_.media_params);
DoInit();
}
-void RenderViewContextMenu::InitMenu(ContextNode node) {
+void RenderViewContextMenu::InitMenu(ContextNode node,
+ ContextMenuMediaParams media_params) {
if (node.type & ContextNode::PAGE)
AppendPageItems();
if (node.type & ContextNode::FRAME)
@@ -60,6 +70,18 @@ void RenderViewContextMenu::InitMenu(ContextNode node) {
AppendImageItems();
}
+ if (node.type & ContextNode::VIDEO) {
+ if (node.type & ContextNode::LINK)
+ AppendSeparator();
+ AppendVideoItems(media_params);
+ }
+
+ if (node.type & ContextNode::AUDIO) {
+ if (node.type & ContextNode::LINK)
+ AppendSeparator();
+ AppendAudioItems(media_params);
+ }
+
if (node.type & ContextNode::EDITABLE)
AppendEditableItems();
else if (node.type & ContextNode::SELECTION ||
@@ -98,6 +120,58 @@ void RenderViewContextMenu::AppendImageItems() {
AppendMenuItem(IDS_CONTENT_CONTEXT_OPENIMAGENEWTAB);
}
+void RenderViewContextMenu::AppendAudioItems(
+ ContextMenuMediaParams media_params) {
+ AppendMediaItems(media_params);
+ AppendSeparator();
+ AppendMenuItem(IDS_CONTENT_CONTEXT_SAVEAUDIOAS);
+ AppendMenuItem(IDS_CONTENT_CONTEXT_COPYAUDIOLOCATION);
+ AppendMenuItem(IDS_CONTENT_CONTEXT_OPENAUDIONEWTAB);
+}
+
+void RenderViewContextMenu::AppendVideoItems(
+ ContextMenuMediaParams media_params) {
+ AppendMediaItems(media_params);
+ AppendMenuItem(IDS_CONTENT_CONTEXT_FULLSCREEN);
+ AppendSeparator();
+ AppendMenuItem(IDS_CONTENT_CONTEXT_SAVEVIDEOAS);
+ AppendMenuItem(IDS_CONTENT_CONTEXT_SAVESCREENSHOTAS);
+ AppendMenuItem(IDS_CONTENT_CONTEXT_COPYVIDEOLOCATION);
+ AppendMenuItem(IDS_CONTENT_CONTEXT_OPENVIDEONEWTAB);
+}
+
+void RenderViewContextMenu::AppendMediaItems(
+ ContextMenuMediaParams media_params) {
+ if (media_params.player_state & ContextMenuMediaParams::PLAYER_PAUSED) {
+ AppendMenuItem(IDS_CONTENT_CONTEXT_PLAY);
+ } else {
+ AppendMenuItem(IDS_CONTENT_CONTEXT_PAUSE);
+ }
+
+ if (media_params.player_state & ContextMenuMediaParams::PLAYER_MUTED) {
+ AppendMenuItem(IDS_CONTENT_CONTEXT_UNMUTE);
+ } else {
+ AppendMenuItem(IDS_CONTENT_CONTEXT_MUTE);
+ }
+
+ AppendCheckboxMenuItem(IDS_CONTENT_CONTEXT_LOOP,
+ l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_LOOP));
+
+ StartSubMenu(IDS_CONTENT_CONTEXT_PLAYBACKRATE_MENU,
+ l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAYBACKRATE_MENU));
+ AppendRadioMenuItem(IDS_CONTENT_CONTEXT_PLAYBACKRATE_SLOW,
+ l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAYBACKRATE_SLOW));
+ AppendRadioMenuItem(IDS_CONTENT_CONTEXT_PLAYBACKRATE_NORMAL,
+ l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAYBACKRATE_NORMAL));
+ AppendRadioMenuItem(IDS_CONTENT_CONTEXT_PLAYBACKRATE_FAST,
+ l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAYBACKRATE_FAST));
+ AppendRadioMenuItem(IDS_CONTENT_CONTEXT_PLAYBACKRATE_FASTER,
+ l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAYBACKRATE_FASTER));
+ AppendRadioMenuItem(IDS_CONTENT_CONTEXT_PLAYBACKRATE_DOUBLETIME,
+ l10n_util::GetStringUTF16(IDS_CONTENT_CONTEXT_PLAYBACKRATE_DOUBLETIME));
+ FinishSubMenu();
+}
+
void RenderViewContextMenu::AppendPageItems() {
AppendMenuItem(IDS_CONTENT_CONTEXT_BACK);
AppendMenuItem(IDS_CONTENT_CONTEXT_FORWARD);
@@ -246,20 +320,58 @@ bool RenderViewContextMenu::IsItemCommandEnabled(int id) const {
URLRequest::IsHandledURL(params_.link_url);
case IDS_CONTENT_CONTEXT_SAVEIMAGEAS:
- return params_.image_url.is_valid() &&
- URLRequest::IsHandledURL(params_.image_url);
+ return params_.src_url.is_valid() &&
+ URLRequest::IsHandledURL(params_.src_url);
case IDS_CONTENT_CONTEXT_OPENIMAGENEWTAB:
// The images shown in the most visited thumbnails do not currently open
// in a new tab as they should. Disabling this context menu option for
// now, as a quick hack, before we resolve this issue (Issue = 2608).
// TODO (sidchat): Enable this option once this issue is resolved.
- if (params_.image_url.scheme() == chrome::kChromeUIScheme)
+ if (params_.src_url.scheme() == chrome::kChromeUIScheme)
return false;
return true;
+ case IDS_CONTENT_CONTEXT_FULLSCREEN:
+ // TODO(ajwong): Enable fullsceren after we actually implement this.
+ return false;
+
+ // Media control commands should all be disabled if the player is in an
+ // error state.
+ case IDS_CONTENT_CONTEXT_PLAY:
+ case IDS_CONTENT_CONTEXT_PAUSE:
+ case IDS_CONTENT_CONTEXT_MUTE:
+ case IDS_CONTENT_CONTEXT_UNMUTE:
+ case IDS_CONTENT_CONTEXT_LOOP:
+ case IDS_CONTENT_CONTEXT_PLAYBACKRATE_MENU:
+ case IDS_CONTENT_CONTEXT_PLAYBACKRATE_SLOW:
+ case IDS_CONTENT_CONTEXT_PLAYBACKRATE_NORMAL:
+ case IDS_CONTENT_CONTEXT_PLAYBACKRATE_FAST:
+ case IDS_CONTENT_CONTEXT_PLAYBACKRATE_FASTER:
+ case IDS_CONTENT_CONTEXT_PLAYBACKRATE_DOUBLETIME:
+ return (params_.media_params.player_state &
+ ContextMenuMediaParams::PLAYER_ERROR) == 0;
+
+ case IDS_CONTENT_CONTEXT_SAVESCREENSHOTAS:
+ // TODO(ajwong): Enable save screenshot after we actually implement
+ // this.
+ return false;
+
+ case IDS_CONTENT_CONTEXT_COPYAUDIOLOCATION:
+ case IDS_CONTENT_CONTEXT_COPYVIDEOLOCATION:
case IDS_CONTENT_CONTEXT_COPYIMAGELOCATION:
- return params_.image_url.is_valid();
+ return params_.src_url.is_valid();
+
+ case IDS_CONTENT_CONTEXT_SAVEAUDIOAS:
+ case IDS_CONTENT_CONTEXT_SAVEVIDEOAS:
+ return (params_.media_params.player_state &
+ ContextMenuMediaParams::PLAYER_CAN_SAVE) &&
+ params_.src_url.is_valid() &&
+ URLRequest::IsHandledURL(params_.src_url);
+
+ case IDS_CONTENT_CONTEXT_OPENAUDIONEWTAB:
+ case IDS_CONTENT_CONTEXT_OPENVIDEONEWTAB:
+ return true;
case IDS_CONTENT_CONTEXT_SAVEPAGEAS:
return SavePackage::IsSavableURL(source_tab_contents_->GetURL());
@@ -324,6 +436,29 @@ bool RenderViewContextMenu::IsItemCommandEnabled(int id) const {
}
bool RenderViewContextMenu::ItemIsChecked(int id) const {
+ // Select the correct playback rate.
+ if (id == IDS_CONTENT_CONTEXT_PLAYBACKRATE_SLOW) {
+ return params_.media_params.playback_rate == kSlowPlaybackRate;
+ }
+ if (id == IDS_CONTENT_CONTEXT_PLAYBACKRATE_NORMAL) {
+ return params_.media_params.playback_rate == kNormalPlaybackRate;
+ }
+ if (id == IDS_CONTENT_CONTEXT_PLAYBACKRATE_FAST) {
+ return params_.media_params.playback_rate == kFastPlaybackRate;
+ }
+ if (id == IDS_CONTENT_CONTEXT_PLAYBACKRATE_FASTER) {
+ return params_.media_params.playback_rate == kFasterPlaybackRate;
+ }
+ if (id == IDS_CONTENT_CONTEXT_PLAYBACKRATE_DOUBLETIME) {
+ return params_.media_params.playback_rate == kDoubleTimePlaybackRate;
+ }
+
+ // See if the video is set to looping.
+ if (id == IDS_CONTENT_CONTEXT_LOOP) {
+ return (params_.media_params.player_state &
+ ContextMenuMediaParams::PLAYER_LOOP) != 0;
+ }
+
// Check box for 'Check the Spelling of this field'.
if (id == IDC_CHECK_SPELLING_OF_THIS_FIELD) {
return (params_.spellcheck_enabled &&
@@ -371,13 +506,15 @@ void RenderViewContextMenu::ExecuteItemCommand(int id) {
OpenURL(params_.link_url, OFF_THE_RECORD, PageTransition::LINK);
break;
+ case IDS_CONTENT_CONTEXT_SAVEAUDIOAS:
+ case IDS_CONTENT_CONTEXT_SAVEVIDEOAS:
case IDS_CONTENT_CONTEXT_SAVEIMAGEAS:
case IDS_CONTENT_CONTEXT_SAVELINKAS: {
const GURL& referrer =
params_.frame_url.is_empty() ? params_.page_url : params_.frame_url;
const GURL& url =
(id == IDS_CONTENT_CONTEXT_SAVELINKAS ? params_.link_url :
- params_.image_url);
+ params_.src_url);
DownloadManager* dlm = profile_->GetDownloadManager();
dlm->DownloadUrl(url, referrer, params_.frame_charset,
source_tab_contents_);
@@ -388,16 +525,20 @@ void RenderViewContextMenu::ExecuteItemCommand(int id) {
WriteURLToClipboard(params_.unfiltered_link_url);
break;
+ case IDS_CONTENT_CONTEXT_COPYAUDIOLOCATION:
+ case IDS_CONTENT_CONTEXT_COPYVIDEOLOCATION:
case IDS_CONTENT_CONTEXT_COPYIMAGELOCATION:
- WriteURLToClipboard(params_.image_url);
+ WriteURLToClipboard(params_.src_url);
break;
case IDS_CONTENT_CONTEXT_COPYIMAGE:
CopyImageAt(params_.x, params_.y);
break;
+ case IDS_CONTENT_CONTEXT_OPENAUDIONEWTAB:
+ case IDS_CONTENT_CONTEXT_OPENVIDEONEWTAB:
case IDS_CONTENT_CONTEXT_OPENIMAGENEWTAB:
- OpenURL(params_.image_url, NEW_BACKGROUND_TAB, PageTransition::LINK);
+ OpenURL(params_.src_url, NEW_BACKGROUND_TAB, PageTransition::LINK);
break;
case IDS_CONTENT_CONTEXT_BACK:
@@ -632,8 +773,7 @@ void RenderViewContextMenu::Inspect(int x, int y) {
source_tab_contents_->render_view_host(), x, y);
}
-void RenderViewContextMenu::WriteTextToClipboard(
- const string16& text) {
+void RenderViewContextMenu::WriteTextToClipboard(const string16& text) {
Clipboard* clipboard = g_browser_process->clipboard();
if (!clipboard)
diff --git a/chrome/browser/tab_contents/render_view_context_menu.h b/chrome/browser/tab_contents/render_view_context_menu.h
index 95595c1..4fc97f6 100644
--- a/chrome/browser/tab_contents/render_view_context_menu.h
+++ b/chrome/browser/tab_contents/render_view_context_menu.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -25,7 +25,7 @@ class RenderViewContextMenu {
void Init();
protected:
- void InitMenu(ContextNode node);
+ void InitMenu(ContextNode node, ContextMenuMediaParams media_params);
// Functions to be implemented by platform-specific subclasses ---------------
@@ -76,6 +76,9 @@ class RenderViewContextMenu {
void AppendDeveloperItems();
void AppendLinkItems();
void AppendImageItems();
+ void AppendAudioItems(ContextMenuMediaParams media_params);
+ void AppendVideoItems(ContextMenuMediaParams media_params);
+ void AppendMediaItems(ContextMenuMediaParams media_params);
void AppendPageItems();
void AppendFrameItems();
void AppendCopyItem();
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index c887d40..41b9466 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -820,6 +820,20 @@ struct ParamTraits<ViewHostMsg_FrameNavigate_Params> {
};
template <>
+struct ParamTraits<ContextMenuMediaParams> {
+ typedef ContextMenuMediaParams param_type;
+ static void Write(Message* m, const param_type& p) {
+ WriteParam(m, p.player_state);
+ WriteParam(m, p.playback_rate);
+ }
+ static bool Read(const Message* m, void** iter, param_type* p) {
+ return
+ ReadParam(m, iter, &p->player_state) &&
+ ReadParam(m, iter, &p->playback_rate);
+ }
+};
+
+template <>
struct ParamTraits<ContextMenuParams> {
typedef ContextMenuParams param_type;
static void Write(Message* m, const param_type& p) {
@@ -828,9 +842,10 @@ struct ParamTraits<ContextMenuParams> {
WriteParam(m, p.y);
WriteParam(m, p.link_url);
WriteParam(m, p.unfiltered_link_url);
- WriteParam(m, p.image_url);
+ WriteParam(m, p.src_url);
WriteParam(m, p.page_url);
WriteParam(m, p.frame_url);
+ WriteParam(m, p.media_params);
WriteParam(m, p.selection_text);
WriteParam(m, p.misspelled_word);
WriteParam(m, p.dictionary_suggestions);
@@ -846,9 +861,10 @@ struct ParamTraits<ContextMenuParams> {
ReadParam(m, iter, &p->y) &&
ReadParam(m, iter, &p->link_url) &&
ReadParam(m, iter, &p->unfiltered_link_url) &&
- ReadParam(m, iter, &p->image_url) &&
+ ReadParam(m, iter, &p->src_url) &&
ReadParam(m, iter, &p->page_url) &&
ReadParam(m, iter, &p->frame_url) &&
+ ReadParam(m, iter, &p->media_params) &&
ReadParam(m, iter, &p->selection_text) &&
ReadParam(m, iter, &p->misspelled_word) &&
ReadParam(m, iter, &p->dictionary_suggestions) &&
diff --git a/chrome/renderer/render_view.cc b/chrome/renderer/render_view.cc
index 9967ca9..a7445c0 100644
--- a/chrome/renderer/render_view.cc
+++ b/chrome/renderer/render_view.cc
@@ -1977,9 +1977,10 @@ void RenderView::ShowContextMenu(WebView* webview,
int x,
int y,
const GURL& link_url,
- const GURL& image_url,
+ const GURL& src_url,
const GURL& page_url,
const GURL& frame_url,
+ const ContextMenuMediaParams& media_params,
const std::wstring& selection_text,
const std::wstring& misspelled_word,
int edit_flags,
@@ -1989,11 +1990,12 @@ void RenderView::ShowContextMenu(WebView* webview,
params.node = node;
params.x = x;
params.y = y;
- params.image_url = image_url;
+ params.src_url = src_url;
params.link_url = link_url;
params.unfiltered_link_url = link_url;
params.page_url = page_url;
params.frame_url = frame_url;
+ params.media_params = media_params;
params.selection_text = selection_text;
params.misspelled_word = misspelled_word;
params.spellcheck_enabled =
diff --git a/chrome/renderer/render_view.h b/chrome/renderer/render_view.h
index 4310d47..7cc65cf 100644
--- a/chrome/renderer/render_view.h
+++ b/chrome/renderer/render_view.h
@@ -53,6 +53,7 @@ class WebFrame;
class WebPluginDelegate;
class WebPluginDelegateProxy;
class WebDevToolsAgentDelegate;
+struct ContextMenuMediaParams;
struct ThumbnailScore;
struct ViewMsg_Navigate_Params;
struct ViewMsg_UploadFile_Params;
@@ -264,9 +265,10 @@ class RenderView : public RenderWidget,
int x,
int y,
const GURL& link_url,
- const GURL& image_url,
+ const GURL& src_url,
const GURL& page_url,
const GURL& frame_url,
+ const ContextMenuMediaParams& media_params,
const std::wstring& selection_text,
const std::wstring& misspelled_word,
int edit_flags,