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

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

Issue 2678083005: Remove extension-to-component migration mechanism (Closed)
Patch Set: Address Derek's comments Created 3 years, 10 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 <memory> 8 #include <memory>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h" 13 #include "chrome/browser/ui/toolbar/toolbar_actions_bar.h"
14 14
15 class Browser; 15 class Browser;
16 class Profile; 16 class Profile;
17 class ToolbarActionViewController; 17 class ToolbarActionViewController;
18 18
19 namespace extensions {
20 class ComponentMigrationHelper;
21 } // extensions
22
23 // The registry for all component toolbar actions. Component toolbar actions 19 // The registry for all component toolbar actions. Component toolbar actions
24 // 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
25 // components of chrome, such as ChromeCast. 21 // components of chrome, such as ChromeCast.
26 class ComponentToolbarActionsFactory { 22 class ComponentToolbarActionsFactory {
27 public: 23 public:
28 // Component action IDs. 24 // Component action IDs.
29 static const char kMediaRouterActionId[]; 25 static const char kMediaRouterActionId[];
30 26
31 ComponentToolbarActionsFactory(); 27 ComponentToolbarActionsFactory();
32 virtual ~ComponentToolbarActionsFactory(); 28 virtual ~ComponentToolbarActionsFactory();
33 29
34 static ComponentToolbarActionsFactory* GetInstance(); 30 static ComponentToolbarActionsFactory* GetInstance();
35 31
36 // Returns a vector of IDs of the component actions. 32 // Returns a vector of IDs of the component actions.
37 virtual std::set<std::string> GetInitialComponentIds(Profile* profile); 33 virtual std::set<std::string> GetInitialComponentIds(Profile* profile);
38 34
39 // Returns a collection of controllers for component actions. Declared 35 // Returns a collection of controllers for component actions. Declared
40 // virtual for testing. 36 // virtual for testing.
41 virtual std::unique_ptr<ToolbarActionViewController> 37 virtual std::unique_ptr<ToolbarActionViewController>
42 GetComponentToolbarActionForId(const std::string& id, 38 GetComponentToolbarActionForId(const std::string& id,
43 Browser* browser, 39 Browser* browser,
44 ToolbarActionsBar* bar); 40 ToolbarActionsBar* bar);
45 41
46 // Registers component actions that are migrating from extensions.
47 virtual void RegisterComponentMigrations(
48 extensions::ComponentMigrationHelper* helper) const;
49
50 // Synchronizes component action visibility and extension install status.
51 virtual void HandleComponentMigrations(
52 extensions::ComponentMigrationHelper* helper,
53 Profile* profile) const;
54
55 // Sets the factory to use for testing purposes. 42 // Sets the factory to use for testing purposes.
56 // Ownership remains with the caller. 43 // Ownership remains with the caller.
57 static void SetTestingFactory(ComponentToolbarActionsFactory* factory); 44 static void SetTestingFactory(ComponentToolbarActionsFactory* factory);
58 45
59 private: 46 private:
60 DISALLOW_COPY_AND_ASSIGN(ComponentToolbarActionsFactory); 47 DISALLOW_COPY_AND_ASSIGN(ComponentToolbarActionsFactory);
61 }; 48 };
62 49
63 #endif // CHROME_BROWSER_UI_TOOLBAR_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_ 50 #endif // CHROME_BROWSER_UI_TOOLBAR_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/component_action_delegate.h ('k') | chrome/browser/ui/toolbar/component_toolbar_actions_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698