Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_MOCK_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_MOCK_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_ |
| 6 #define CHROME_BROWSER_UI_TOOLBAR_MOCK_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_MOCK_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h" | 9 #include "chrome/browser/ui/toolbar/component_toolbar_actions_factory.h" |
| 10 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" | 10 #include "chrome/browser/ui/toolbar/toolbar_actions_model.h" |
| 11 | 11 |
| 12 class Browser; | 12 class Browser; |
| 13 | 13 |
| 14 // Mock class used to substitute ComponentToolbarActionsFactory in tests. | 14 // Mock class used to substitute ComponentToolbarActionsFactory in tests. |
| 15 class MockComponentToolbarActionsFactory | 15 class MockComponentToolbarActionsFactory |
| 16 : public ComponentToolbarActionsFactory { | 16 : public ComponentToolbarActionsFactory { |
| 17 public: | 17 public: |
| 18 static const char kActionIdForTesting[]; | 18 static const char kActionIdForTesting[]; |
| 19 | 19 |
| 20 explicit MockComponentToolbarActionsFactory(Browser* browser); | 20 MockComponentToolbarActionsFactory(Profile* profile, |
| 21 ToolbarActionsModel* actions_model); | |
| 21 ~MockComponentToolbarActionsFactory() override; | 22 ~MockComponentToolbarActionsFactory() override; |
| 22 | 23 |
| 23 // ComponentToolbarActionsFactory: | 24 // ComponentToolbarActionsFactory: |
| 24 std::set<std::string> GetInitialComponentIds(Profile* profile) override; | 25 std::set<std::string> GetInitialComponentIds() override; |
| 25 std::unique_ptr<ToolbarActionViewController> GetComponentToolbarActionForId( | 26 std::unique_ptr<ToolbarActionViewController> GetComponentToolbarActionForId( |
| 26 const std::string& id, | 27 const std::string& id, |
| 27 Browser* browser, | 28 Browser* browser, |
| 28 ToolbarActionsBar* bar) override; | 29 ToolbarActionsBar* bar) override; |
| 29 | 30 |
|
msw
2017/01/10 23:23:59
nit: no blank lines between overrides for the same
takumif
2017/02/17 03:22:51
Removed migration-related code.
| |
| 30 void RegisterComponentMigrations( | 31 void RegisterComponentMigrations() override; |
| 31 extensions::ComponentMigrationHelper* helper) const override; | |
| 32 | 32 |
|
msw
2017/01/10 23:23:59
ditto nit
takumif
2017/02/17 03:22:51
Removed migration-related code.
| |
| 33 void HandleComponentMigrations(extensions::ComponentMigrationHelper* helper, | 33 void HandleComponentMigrations() override; |
| 34 Profile* profile) const override; | |
| 35 | 34 |
| 36 void set_migrated_extension_id(const extensions::ExtensionId& extension_id) { | 35 void set_migrated_extension_id(const extensions::ExtensionId& extension_id) { |
| 37 migrated_extension_id_ = extension_id; | 36 migrated_extension_id_ = extension_id; |
| 38 } | 37 } |
| 39 | 38 |
| 40 void set_migrated_feature_enabled(bool enabled) { | 39 void set_migrated_feature_enabled(bool enabled) { |
| 41 migrated_feature_enabled_ = enabled; | 40 migrated_feature_enabled_ = enabled; |
| 42 } | 41 } |
| 43 | 42 |
| 44 private: | 43 private: |
| 45 extensions::ExtensionId migrated_extension_id_; | 44 extensions::ExtensionId migrated_extension_id_; |
| 46 bool migrated_feature_enabled_; | 45 bool migrated_feature_enabled_; |
| 47 | 46 |
| 48 DISALLOW_COPY_AND_ASSIGN(MockComponentToolbarActionsFactory); | 47 DISALLOW_COPY_AND_ASSIGN(MockComponentToolbarActionsFactory); |
| 49 }; | 48 }; |
| 50 | 49 |
| 51 #endif // CHROME_BROWSER_UI_TOOLBAR_MOCK_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_ | 50 #endif // CHROME_BROWSER_UI_TOOLBAR_MOCK_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_ |
| OLD | NEW |