Infobar material design refresh: layout
[chromium-blink-merge.git] / chrome / browser / ui / toolbar / component_toolbar_actions_factory.h
blob017138813ef279c38f82a70904a1e1df7cd8524b
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_TOOLBAR_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_
6 #define CHROME_BROWSER_UI_TOOLBAR_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_
8 #include "base/macros.h"
9 #include "base/memory/scoped_vector.h"
11 class Browser;
12 class Profile;
13 class ToolbarActionViewController;
15 // The registry for all component toolbar actions. Component toolbar actions
16 // are actions that live in the toolbar (like extension actions), but are
17 // components of chrome, such as ChromeCast.
18 class ComponentToolbarActionsFactory {
19 public:
20 // Component action IDs.
21 static const char kMediaRouterActionId[];
22 static const char kActionIdForTesting[]; // Only used for testing.
24 ComponentToolbarActionsFactory();
25 virtual ~ComponentToolbarActionsFactory();
27 static ComponentToolbarActionsFactory* GetInstance();
29 // Returns a vector of IDs of the component actions.
30 static std::vector<std::string> GetComponentIds();
32 // Returns true if the component action with |action_id| should be added
33 // in incognito mode.
34 static bool EnabledIncognito(const std::string& action_id);
36 // Returns a collection of controllers for component actions. Declared
37 // virtual for testing.
38 virtual ScopedVector<ToolbarActionViewController>
39 GetComponentToolbarActions(Browser* browser);
41 // Sets the factory to use for testing purposes.
42 // Ownership remains with the caller.
43 static void SetTestingFactory(ComponentToolbarActionsFactory* factory);
45 private:
46 DISALLOW_COPY_AND_ASSIGN(ComponentToolbarActionsFactory);
49 #endif // CHROME_BROWSER_UI_TOOLBAR_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_