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

Unified Diff: chrome/browser/tab_contents/render_view_context_menu.cc

Issue 3124032: Add Full screen item to video context menu (Closed)
Patch Set: Change user metric name. Created 10 years, 4 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
« no previous file with comments | « chrome/app/chrome_dll_resource.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « chrome/app/chrome_dll_resource.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698