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

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

Issue 1415333002: [Media Router] Add experiment control logic. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed msw@'s comments Created 5 years, 2 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
Index: chrome/browser/renderer_context_menu/render_view_context_menu.cc
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
index 753cd8a1a231a465ef133e9a3c782c5c0c9986cc..4d7ee6b308c011e5f78a53d4259fdcf68efd73b6 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -123,6 +123,10 @@
#endif // defined(ENABLE_PRINT_PREVIEW)
#endif // defined(ENABLE_PRINTING)
+#if defined(ENABLE_MEDIA_ROUTER)
+#include "chrome/browser/media/router/media_router_feature.h"
+#endif // defined(ENABLE_MEDIA_ROUTER)
+
using base::UserMetricsAction;
using blink::WebContextMenuData;
using blink::WebMediaPlayerAction;
@@ -954,9 +958,13 @@ void RenderViewContextMenu::AppendPrintItem() {
}
void RenderViewContextMenu::AppendMediaRouterItem() {
- if (switches::MediaRouterEnabled() && !browser_context_->IsOffTheRecord())
+#if defined(ENABLE_MEDIA_ROUTER)
+ if (media_router::MediaRouterEnabled() &&
+ !browser_context_->IsOffTheRecord()) {
menu_model_.AddItemWithStringId(IDC_ROUTE_MEDIA,
IDS_MEDIA_ROUTER_MENU_ITEM_TITLE);
+ }
+#endif // defined(ENABLE_MEDIA_ROUTER)
}
void RenderViewContextMenu::AppendRotationItems() {
@@ -1415,7 +1423,8 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const {
return true;
case IDC_ROUTE_MEDIA: {
- DCHECK(switches::MediaRouterEnabled());
+#if defined(ENABLE_MEDIA_ROUTER)
+ DCHECK(media_router::MediaRouterEnabled());
// Disable the command if there is an active modal dialog.
Browser* browser =
@@ -1432,6 +1441,10 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const {
web_modal::WebContentsModalDialogManager::FromWebContents(
web_contents);
return !manager || !manager->IsDialogActive();
+#else
+ NOTREACHED();
+ return false;
+#endif // defined(ENABLE_MEDIA_ROUTER)
}
default:
@@ -1713,7 +1726,8 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
}
case IDC_ROUTE_MEDIA: {
- DCHECK(switches::MediaRouterEnabled());
+#if defined(ENABLE_MEDIA_ROUTER)
+ DCHECK(media_router::MediaRouterEnabled());
Browser* browser =
chrome::FindBrowserWithWebContents(source_web_contents_);
@@ -1727,6 +1741,9 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
return;
dialog_controller->ShowMediaRouterDialog();
+#else
+ NOTREACHED();
+#endif // defined(ENABLE_MEDIA_ROUTER)
break;
}

Powered by Google App Engine
This is Rietveld 408576698