ExtensionSyncService: listen for relevant changes instead of being explicitly called...
[chromium-blink-merge.git] / chrome / browser / ui / toolbar / mock_component_toolbar_actions_factory.cc
blob9694d90652b0561174c56df3c9361a31d62afa6d
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/toolbar/mock_component_toolbar_actions_factory.h"
7 #include "chrome/browser/ui/browser.h"
8 #include "chrome/browser/ui/toolbar/test_toolbar_action_view_controller.h"
9 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
11 MockComponentToolbarActionsFactory::MockComponentToolbarActionsFactory(
12 Browser* browser) {
13 ComponentToolbarActionsFactory::SetTestingFactory(this);
15 ScopedVector<ToolbarActionViewController> actions =
16 GetComponentToolbarActions(browser);
17 for (const ToolbarActionViewController* action : actions)
18 action_ids_.push_back(action->GetId());
21 MockComponentToolbarActionsFactory::~MockComponentToolbarActionsFactory() {
22 ComponentToolbarActionsFactory::SetTestingFactory(nullptr);
25 ScopedVector<ToolbarActionViewController>
26 MockComponentToolbarActionsFactory::GetComponentToolbarActions(
27 Browser* browser) {
28 ScopedVector<ToolbarActionViewController> component_actions;
29 component_actions.push_back(new TestToolbarActionViewController(
30 ComponentToolbarActionsFactory::kActionIdForTesting));
31 return component_actions.Pass();