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

Side by Side Diff: chrome/browser/ui/toolbar/component_toolbar_actions_factory.cc

Issue 2332693003: Show media router toolbar icon ephemerally for active local routes and issues (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h" 5 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/lazy_instance.h" 8 #include "base/lazy_instance.h"
9 #include "chrome/browser/extensions/component_migration_helper.h" 9 #include "chrome/browser/extensions/component_migration_helper.h"
10 #include "chrome/browser/media/router/media_router_feature.h" 10 #include "chrome/browser/media/router/media_router_feature.h"
11 #include "chrome/browser/media/router/media_router_ui_service.h"
11 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
12 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
13 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" 14 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
14 #include "extensions/common/feature_switch.h" 15 #include "extensions/common/feature_switch.h"
15 16
16 #if defined(ENABLE_MEDIA_ROUTER) 17 #if defined(ENABLE_MEDIA_ROUTER)
17 #include "chrome/browser/ui/toolbar/media_router_action.h" 18 #include "chrome/browser/ui/toolbar/media_router_action.h"
18 #endif 19 #endif
19 20
20 namespace { 21 namespace {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 void ComponentToolbarActionsFactory::HandleComponentMigrations( 88 void ComponentToolbarActionsFactory::HandleComponentMigrations(
88 extensions::ComponentMigrationHelper* helper, 89 extensions::ComponentMigrationHelper* helper,
89 Profile* profile) const { 90 Profile* profile) const {
90 if (media_router::MediaRouterEnabled(profile)) { 91 if (media_router::MediaRouterEnabled(profile)) {
91 helper->OnFeatureEnabled(kMediaRouterActionId); 92 helper->OnFeatureEnabled(kMediaRouterActionId);
92 } else { 93 } else {
93 helper->OnFeatureDisabled(kMediaRouterActionId); 94 helper->OnFeatureDisabled(kMediaRouterActionId);
94 } 95 }
95 } 96 }
96 97
98 void ComponentToolbarActionsFactory::InitializeComponentActionControllers(
99 Profile* profile) {
100 if (media_router::MediaRouterEnabled(profile))
101 media_router::MediaRouterUIService::Get(profile);
Devlin 2016/09/15 21:19:17 Would this same effect be achieved by KeyedService
takumif 2016/09/16 21:19:22 Yes, using ServiceIsCreatedWithContext() (didn't k
102 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698