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

Unified Diff: chrome/browser/ui/toolbar/component_toolbar_actions_factory.h

Issue 2693063003: Unload old Cast extensions after initializing ToolbarActionsModel (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/toolbar/component_toolbar_actions_factory.h
diff --git a/chrome/browser/ui/toolbar/component_toolbar_actions_factory.h b/chrome/browser/ui/toolbar/component_toolbar_actions_factory.h
index 7768b7db6eff8c9730aeab98e1df927f0264d65a..49d92c8a5605fdeaf650ca010595db80bd1b274a 100644
--- a/chrome/browser/ui/toolbar/component_toolbar_actions_factory.h
+++ b/chrome/browser/ui/toolbar/component_toolbar_actions_factory.h
@@ -13,15 +13,22 @@
#include "chrome/browser/ui/toolbar/toolbar_actions_bar.h"
class Browser;
+class ExtensionService;
class Profile;
class ToolbarActionViewController;
+namespace extensions {
+class ExtensionRegistry;
+}
+
// The registry for all component toolbar actions. Component toolbar actions
// are actions that live in the toolbar (like extension actions), but are
// components of chrome, such as ChromeCast.
class ComponentToolbarActionsFactory {
public:
- // Component action IDs.
+ // Extension and component action IDs.
+ static const char kCastBetaExtensionId[];
+ static const char kCastExtensionId[];
static const char kMediaRouterActionId[];
ComponentToolbarActionsFactory();
@@ -39,11 +46,22 @@ class ComponentToolbarActionsFactory {
Browser* browser,
ToolbarActionsBar* bar);
+ // Unloads extensions that were migrated to component actions and therefore
+ // are no longer needed.
+ virtual void UnloadMigratedExtensions(
+ ExtensionService* service,
+ extensions::ExtensionRegistry* registry);
+
// Sets the factory to use for testing purposes.
// Ownership remains with the caller.
static void SetTestingFactory(ComponentToolbarActionsFactory* factory);
private:
+ // Unloads an extension if it is active.
+ void UnloadExtension(ExtensionService* service,
+ extensions::ExtensionRegistry* registry,
+ const std::string& extension_id);
+
DISALLOW_COPY_AND_ASSIGN(ComponentToolbarActionsFactory);
};

Powered by Google App Engine
This is Rietveld 408576698