Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Side by Side Diff: chrome/browser/ui/toolbar/component_toolbar_actions_factory.h

Issue 1241063003: Support Component Actions in the toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Switch GetComponentActionId to unix_hacker_style. Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 10
11 class Browser; 11 class Browser;
12 class Profile; 12 class Profile;
13 class ToolbarActionViewController; 13 class ToolbarActionViewController;
14 14
15 // The registry for all component toolbar actions. Component toolbar actions 15 // The registry for all component toolbar actions. Component toolbar actions
16 // are actions that live in the toolbar (like extension actions), but are 16 // are actions that live in the toolbar (like extension actions), but are
17 // components of chrome, such as ChromeCast. 17 // components of chrome, such as ChromeCast.
18 class ComponentToolbarActionsFactory { 18 class ComponentToolbarActionsFactory {
19 public: 19 public:
20 // Component action IDs.
21 static const char kMediaRouterActionId[];
22 static const char kActionIdForTesting[]; // Only used for testing.
23
20 ComponentToolbarActionsFactory(); 24 ComponentToolbarActionsFactory();
21 ~ComponentToolbarActionsFactory(); 25 virtual ~ComponentToolbarActionsFactory();
22 26
23 static ComponentToolbarActionsFactory* GetInstance(); 27 static ComponentToolbarActionsFactory* GetInstance();
24 28
25 // Returns a collection of controllers for Chrome Actions. Declared virtual 29 // Returns a vector of IDs of the component actions.
26 // for testing. 30 static std::vector<std::string> GetComponentIds();
31
32 // Returns a collection of controllers for component actions. Declared
33 // virtual for testing.
27 virtual ScopedVector<ToolbarActionViewController> 34 virtual ScopedVector<ToolbarActionViewController>
28 GetComponentToolbarActions(Browser* browser); 35 GetComponentToolbarActions(Browser* browser);
29 36
30 // Returns the number of component actions.
31 int GetNumComponentActions(Browser* browser);
32
33 // Sets the factory to use for testing purposes. 37 // Sets the factory to use for testing purposes.
34 // Ownership remains with the caller. 38 // Ownership remains with the caller.
35 static void SetTestingFactory(ComponentToolbarActionsFactory* factory); 39 static void SetTestingFactory(ComponentToolbarActionsFactory* factory);
36 40
37 private: 41 private:
38 // The number of component actions. Initially set to -1 to denote that the
39 // count has not been checked yet.
40 int num_component_actions_;
41
42 DISALLOW_COPY_AND_ASSIGN(ComponentToolbarActionsFactory); 42 DISALLOW_COPY_AND_ASSIGN(ComponentToolbarActionsFactory);
43 }; 43 };
44 44
45 #endif // CHROME_BROWSER_UI_TOOLBAR_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_ 45 #endif // CHROME_BROWSER_UI_TOOLBAR_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698