| 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 8f64c079393ae0495e3344bb9b04ca3610bcdd75..2222ee0c9ee2cee5821572a9302c28855320e682 100644
|
| --- a/chrome/browser/ui/toolbar/component_toolbar_actions_factory.cc
|
| +++ b/chrome/browser/ui/toolbar/component_toolbar_actions_factory.cc
|
| @@ -20,6 +20,11 @@ base::LazyInstance<ComponentToolbarActionsFactory> lazy_factory =
|
|
|
| } // namespace
|
|
|
| +// static
|
| +const char ComponentToolbarActionsFactory::kMediaRouterActionId[] =
|
| + "media_router_action";
|
| +const char ComponentToolbarActionsFactory::kMockActionId[] = "mock_action";
|
| +
|
| ComponentToolbarActionsFactory::ComponentToolbarActionsFactory()
|
| : num_component_actions_(-1) {}
|
| ComponentToolbarActionsFactory::~ComponentToolbarActionsFactory() {}
|
| @@ -29,6 +34,25 @@ ComponentToolbarActionsFactory* ComponentToolbarActionsFactory::GetInstance() {
|
| return testing_factory_ ? testing_factory_ : &lazy_factory.Get();
|
| }
|
|
|
| +// static
|
| +std::vector<std::string> ComponentToolbarActionsFactory::GetComponentIds() {
|
| + std::vector<std::string> component_ids;
|
| +
|
| + if (testing_factory_) {
|
| + component_ids.push_back(ComponentToolbarActionsFactory::kMockActionId);
|
| + } else {
|
| +#if defined(ENABLE_MEDIA_ROUTER)
|
| + if (base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + ::switches::kEnableMediaRouter)) {
|
| + component_ids.push_back(
|
| + ComponentToolbarActionsFactory::kMediaRouterActionId);
|
| + }
|
| +#endif // ENABLE_MEDIA_ROUTER
|
| + }
|
| +
|
| + return component_ids;
|
| +}
|
| +
|
| ScopedVector<ToolbarActionViewController>
|
| ComponentToolbarActionsFactory::GetComponentToolbarActions(Browser* browser) {
|
| ScopedVector<ToolbarActionViewController> component_actions;
|
|
|