OLD | NEW |
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 #ifndef CHROME_BROWSER_UI_TOOLBAR_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_ |
6 #define CHROME_BROWSER_UI_TOOLBAR_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/macros.h" | 11 #include "base/macros.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" |
13 | 14 |
14 class Browser; | 15 class Browser; |
15 class Profile; | 16 class Profile; |
16 class ToolbarActionViewController; | 17 class ToolbarActionViewController; |
17 | 18 |
18 // The registry for all component toolbar actions. Component toolbar actions | 19 // The registry for all component toolbar actions. Component toolbar actions |
19 // are actions that live in the toolbar (like extension actions), but are | 20 // are actions that live in the toolbar (like extension actions), but are |
20 // components of chrome, such as ChromeCast. | 21 // components of chrome, such as ChromeCast. |
21 class ComponentToolbarActionsFactory { | 22 class ComponentToolbarActionsFactory { |
22 public: | 23 public: |
23 // Component action IDs. | 24 // Component action IDs. |
24 static const char kMediaRouterActionId[]; | 25 static const char kMediaRouterActionId[]; |
25 | 26 |
26 ComponentToolbarActionsFactory(); | 27 ComponentToolbarActionsFactory(); |
27 virtual ~ComponentToolbarActionsFactory(); | 28 virtual ~ComponentToolbarActionsFactory(); |
28 | 29 |
29 static ComponentToolbarActionsFactory* GetInstance(); | 30 static ComponentToolbarActionsFactory* GetInstance(); |
30 | 31 |
31 // Returns a vector of IDs of the component actions. | 32 // Returns a vector of IDs of the component actions. |
32 virtual std::set<std::string> GetInitialComponentIds(Profile* profile); | 33 virtual std::set<std::string> GetInitialComponentIds(Profile* profile); |
33 | 34 |
34 // Returns a collection of controllers for component actions. Declared | 35 // Returns a collection of controllers for component actions. Declared |
35 // virtual for testing. | 36 // virtual for testing. |
36 virtual scoped_ptr<ToolbarActionViewController> | 37 virtual scoped_ptr<ToolbarActionViewController> |
37 GetComponentToolbarActionForId(const std::string& id, Browser* browser); | 38 GetComponentToolbarActionForId(const std::string& id, Browser* browser, |
| 39 ToolbarActionsBar* bar); |
38 | 40 |
39 // Sets the factory to use for testing purposes. | 41 // Sets the factory to use for testing purposes. |
40 // Ownership remains with the caller. | 42 // Ownership remains with the caller. |
41 static void SetTestingFactory(ComponentToolbarActionsFactory* factory); | 43 static void SetTestingFactory(ComponentToolbarActionsFactory* factory); |
42 | 44 |
43 private: | 45 private: |
44 DISALLOW_COPY_AND_ASSIGN(ComponentToolbarActionsFactory); | 46 DISALLOW_COPY_AND_ASSIGN(ComponentToolbarActionsFactory); |
45 }; | 47 }; |
46 | 48 |
47 #endif // CHROME_BROWSER_UI_TOOLBAR_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_ | 49 #endif // CHROME_BROWSER_UI_TOOLBAR_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_ |
OLD | NEW |