Index: chrome/browser/tab_contents/render_view_context_menu.cc |
diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc |
index 3865f403de7c926191d8ada174c826a74118b077..4d7452538e587c324477aa78db79671d83d1e068 100644 |
--- a/chrome/browser/tab_contents/render_view_context_menu.cc |
+++ b/chrome/browser/tab_contents/render_view_context_menu.cc |
@@ -477,6 +477,11 @@ void RenderViewContextMenu::AppendVideoItems() { |
IDS_CONTENT_CONTEXT_COPYVIDEOLOCATION); |
menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_OPENAVNEWTAB, |
IDS_CONTENT_CONTEXT_OPENVIDEONEWTAB); |
+ if (CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableVideoFullscreen)) { |
+ menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_FULLSCREEN, |
+ IDS_CONTENT_CONTEXT_FULLSCREEN); |
+ } |
} |
void RenderViewContextMenu::AppendMediaItems() { |
@@ -852,6 +857,10 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const { |
case IDC_CONTENT_CONTEXT_OPENAVNEWTAB: |
return true; |
+ case IDC_CONTENT_CONTEXT_FULLSCREEN: |
+ return CommandLine::ForCurrentProcess()->HasSwitch( |
+ switches::kEnableVideoFullscreen); |
+ |
case IDC_SAVE_PAGE: { |
// Instead of using GetURL here, we use url() (which is the "real" url of |
// the page) from the NavigationEntry because its reflects their origin |
@@ -1089,6 +1098,15 @@ void RenderViewContextMenu::ExecuteCommand(int id) { |
OpenURL(params_.src_url, NEW_BACKGROUND_TAB, PageTransition::LINK); |
break; |
+ case IDC_CONTENT_CONTEXT_FULLSCREEN: |
+ UserMetrics::RecordAction( |
+ UserMetricsAction("MediaContextMenu_Fullscreen"), |
+ profile_); |
+ MediaPlayerActionAt( |
+ gfx::Point(params_.x, params_.y), |
+ WebMediaPlayerAction(WebMediaPlayerAction::Fullscreen, true)); |
+ break; |
+ |
case IDC_CONTENT_CONTEXT_PLAYPAUSE: { |
bool play = !!(params_.media_flags & WebContextMenuData::MediaPaused); |
if (play) { |