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

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

Issue 1865213004: Convert //chrome/browser/ui from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 8 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 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 explicit MockComponentToolbarActionsFactory(Browser* browser);
21 ~MockComponentToolbarActionsFactory() override; 21 ~MockComponentToolbarActionsFactory() override;
22 22
23 // ComponentToolbarActionsFactory: 23 // ComponentToolbarActionsFactory:
24 std::set<std::string> GetInitialComponentIds(Profile* profile) override; 24 std::set<std::string> GetInitialComponentIds(Profile* profile) override;
25 scoped_ptr<ToolbarActionViewController> GetComponentToolbarActionForId( 25 std::unique_ptr<ToolbarActionViewController> GetComponentToolbarActionForId(
26 const std::string& id, 26 const std::string& id,
27 Browser* browser, 27 Browser* browser,
28 ToolbarActionsBar* bar) override; 28 ToolbarActionsBar* bar) override;
29 29
30 void RegisterComponentMigrations( 30 void RegisterComponentMigrations(
31 extensions::ComponentMigrationHelper* helper) const override; 31 extensions::ComponentMigrationHelper* helper) const override;
32 32
33 void HandleComponentMigrations(extensions::ComponentMigrationHelper* helper, 33 void HandleComponentMigrations(extensions::ComponentMigrationHelper* helper,
34 Profile* profile) const override; 34 Profile* profile) const override;
35 35
36 void set_migrated_extension_id(const extensions::ExtensionId& extension_id) { 36 void set_migrated_extension_id(const extensions::ExtensionId& extension_id) {
37 migrated_extension_id_ = extension_id; 37 migrated_extension_id_ = extension_id;
38 } 38 }
39 39
40 void set_migrated_feature_enabled(bool enabled) { 40 void set_migrated_feature_enabled(bool enabled) {
41 migrated_feature_enabled_ = enabled; 41 migrated_feature_enabled_ = enabled;
42 } 42 }
43 43
44 private: 44 private:
45 extensions::ExtensionId migrated_extension_id_; 45 extensions::ExtensionId migrated_extension_id_;
46 bool migrated_feature_enabled_; 46 bool migrated_feature_enabled_;
47 47
48 DISALLOW_COPY_AND_ASSIGN(MockComponentToolbarActionsFactory); 48 DISALLOW_COPY_AND_ASSIGN(MockComponentToolbarActionsFactory);
49 }; 49 };
50 50
51 #endif // CHROME_BROWSER_UI_TOOLBAR_MOCK_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_ 51 #endif // CHROME_BROWSER_UI_TOOLBAR_MOCK_COMPONENT_TOOLBAR_ACTIONS_FACTORY_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698