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

Unified Diff: chrome/browser/ui/toolbar/component_toolbar_actions_factory.cc

Issue 2559323002: Add a policy to always show the Cast toolbar icon (Closed)
Patch Set: Address Derek's comments Created 4 years 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/ui/toolbar/component_toolbar_actions_factory.cc
diff --git a/chrome/browser/ui/toolbar/component_toolbar_actions_factory.cc b/chrome/browser/ui/toolbar/component_toolbar_actions_factory.cc
index 487a59a88d9ba57f538fb13f71c930c0a21db8ee..a1b5f98fc998476cfd846a54566de0baf26bd957 100644
--- a/chrome/browser/ui/toolbar/component_toolbar_actions_factory.cc
+++ b/chrome/browser/ui/toolbar/component_toolbar_actions_factory.cc
@@ -10,6 +10,7 @@
#include "chrome/browser/media/router/media_router_feature.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/toolbar/media_router_action_controller.h"
#include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
#include "extensions/common/feature_switch.h"
@@ -44,6 +45,10 @@ ComponentToolbarActionsFactory* ComponentToolbarActionsFactory::GetInstance() {
std::set<std::string> ComponentToolbarActionsFactory::GetInitialComponentIds(
Profile* profile) {
std::set<std::string> component_ids;
+ if (media_router::MediaRouterEnabled(profile) &&
+ MediaRouterActionController::IsActionShownByPolicy(profile))
msw 2017/01/05 01:14:57 nit: curlies
takumif 2017/01/06 22:06:57 Done.
+ component_ids.insert(kMediaRouterActionId);
+
return component_ids;
}

Powered by Google App Engine
This is Rietveld 408576698