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

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

Issue 1495653003: [Media Router] Check MediaRouterDialogControllerImpl only sets toolbar MediaRouterAction. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes per pkasting@'s comments. Fixed OSX segfaults. Created 5 years 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
« no previous file with comments | « no previous file | chrome/browser/ui/toolbar/component_toolbar_actions_factory.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/toolbar/component_toolbar_actions_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698