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

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

Issue 2613713005: Make ToolbarActionsModel own ComponentToolbarActionsFactory (Closed)
Patch Set: Fix buildbot failure 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/toolbar_actions_model.h
diff --git a/chrome/browser/ui/toolbar/toolbar_actions_model.h b/chrome/browser/ui/toolbar/toolbar_actions_model.h
index 7a4ac3f4870ba17d0ceaa7eacbc99aee844d9bfc..47847aba8b9ff1ced8d46dcfe122595afffefb63 100644
--- a/chrome/browser/ui/toolbar/toolbar_actions_model.h
+++ b/chrome/browser/ui/toolbar/toolbar_actions_model.h
@@ -21,6 +21,7 @@
#include "extensions/common/extension.h"
class Browser;
+class ComponentToolbarActionsFactory;
class PrefService;
class Profile;
class ToolbarActionsBar;
@@ -170,6 +171,10 @@ class ToolbarActionsModel : public extensions::ExtensionActionAPI::Observer,
has_active_bubble_ = has_active_bubble;
}
+ ComponentToolbarActionsFactory* component_actions_factory() {
+ return component_actions_factory_.get();
+ }
+
void SetActionVisibility(const std::string& action_id, bool visible);
// ComponentActionDelegate:
@@ -197,6 +202,10 @@ class ToolbarActionsModel : public extensions::ExtensionActionAPI::Observer,
std::unique_ptr<extensions::ExtensionMessageBubbleController>
GetExtensionMessageBubbleController(Browser* browser);
+ // Sets the component action factory for this object. Used in tests.
+ void SetMockActionsFactoryForTest(
+ std::unique_ptr<ComponentToolbarActionsFactory> mock_factory);
+
private:
// Callback when actions are ready.
void OnReady();
@@ -286,6 +295,8 @@ class ToolbarActionsModel : public extensions::ExtensionActionAPI::Observer,
// The ExtensionActionManager, cached for convenience.
extensions::ExtensionActionManager* extension_action_manager_;
+ std::unique_ptr<ComponentToolbarActionsFactory> component_actions_factory_;
+
// True if we've handled the initial EXTENSIONS_READY notification.
bool actions_initialized_;

Powered by Google App Engine
This is Rietveld 408576698