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

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: Rebase 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
« no previous file with comments | « chrome/browser/media/router/media_router_feature.cc ('k') | chrome/browser/ui/browser_commands.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 0d6bb6d039d925c1bd0cef3be3f710ed4bee2bbb..ed28d8f507306adfb972ca68cd235207ce6bc1d3 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -30,8 +30,7 @@
#include "chrome/browser/download/download_stats.h"
#include "chrome/browser/extensions/devtools_util.h"
#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/media/router/media_router_dialog_controller.h"
-#include "chrome/browser/media/router/media_router_metrics.h"
+#include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings.h"
#include "chrome/browser/net/spdyproxy/data_reduction_proxy_chrome_settings_factory.h"
#include "chrome/browser/password_manager/chrome_password_manager_client.h"
@@ -135,6 +134,11 @@
#include "chrome/browser/chromeos/profiles/profile_helper.h"
#endif
+#if defined(ENABLE_MEDIA_ROUTER)
+#include "chrome/browser/media/router/media_router_dialog_controller.h"
+#include "chrome/browser/media/router/media_router_metrics.h"
+#endif
+
using base::UserMetricsAction;
using blink::WebContextMenuData;
using blink::WebMediaPlayerAction;
@@ -1067,9 +1071,11 @@ void RenderViewContextMenu::AppendPrintItem() {
}
void RenderViewContextMenu::AppendMediaRouterItem() {
- if (switches::MediaRouterEnabled() && !browser_context_->IsOffTheRecord())
+ if (media_router::MediaRouterEnabled() &&
+ !browser_context_->IsOffTheRecord()) {
menu_model_.AddItemWithStringId(IDC_ROUTE_MEDIA,
IDS_MEDIA_ROUTER_MENU_ITEM_TITLE);
+ }
}
void RenderViewContextMenu::AppendRotationItems() {
@@ -1534,7 +1540,7 @@ bool RenderViewContextMenu::IsCommandIdEnabled(int id) const {
return true;
case IDC_ROUTE_MEDIA: {
- DCHECK(switches::MediaRouterEnabled());
+ DCHECK(media_router::MediaRouterEnabled());
// Disable the command if there is an active modal dialog.
Browser* browser =
@@ -1852,8 +1858,8 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
}
case IDC_ROUTE_MEDIA: {
- DCHECK(switches::MediaRouterEnabled());
-
+ DCHECK(media_router::MediaRouterEnabled());
+#if defined(ENABLE_MEDIA_ROUTER)
Browser* browser =
chrome::FindBrowserWithWebContents(source_web_contents_);
DCHECK(browser && !browser->profile()->IsOffTheRecord());
@@ -1861,15 +1867,13 @@ void RenderViewContextMenu::ExecuteCommand(int id, int event_flags) {
media_router::MediaRouterDialogController* dialog_controller =
media_router::MediaRouterDialogController::GetOrCreateForWebContents(
source_web_contents_);
-
if (!dialog_controller)
return;
dialog_controller->ShowMediaRouterDialog();
-
media_router::MediaRouterMetrics::RecordMediaRouterDialogOrigin(
media_router::CONTEXTUAL_MENU);
-
+#endif // defined(ENABLE_MEDIA_ROUTER)
break;
}
« no previous file with comments | « chrome/browser/media/router/media_router_feature.cc ('k') | chrome/browser/ui/browser_commands.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698