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"
12 class ToolbarActionViewController
;
14 // The registry for all component toolbar actions. Component toolbar actions
15 // are actions that live in the toolbar (like extension actions), but are
16 // components of chrome, such as ChromeCast.
17 class ComponentToolbarActionsFactory
{
19 ComponentToolbarActionsFactory();
20 ~ComponentToolbarActionsFactory();
22 static ComponentToolbarActionsFactory
* GetInstance();
24 // Returns a collection of controllers for Chrome Actions. Declared virtual
26 virtual ScopedVector
<ToolbarActionViewController
>
27 GetComponentToolbarActions();
29 // Returns the number of component actions.
30 int GetNumComponentActions();
32 // Sets the factory to use for testing purposes.
33 // Ownership remains with the caller.
34 static void SetTestingFactory(ComponentToolbarActionsFactory
* factory
);
37 // The number of component actions. Initially set to -1 to denote that the
38 // count has not been checked yet.
39 int num_component_actions_
;
41 // Whether or not Media Router UI is currently enabled.
42 // TODO(apacible): Replace this with a switch once there is more Media Router
44 bool media_router_ui_enabled_
;
46 DISALLOW_COPY_AND_ASSIGN(ComponentToolbarActionsFactory
);
49 #endif // CHROME_BROWSER_UI_TOOLBAR_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_