OLD | NEW |
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 #include "chrome/browser/extensions/extension_action_test_util.h" | 5 #include "chrome/browser/extensions/extension_action_test_util.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/run_loop.h" | 10 #include "base/run_loop.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 } | 74 } |
75 } | 75 } |
76 } | 76 } |
77 | 77 |
78 return count; | 78 return count; |
79 } | 79 } |
80 | 80 |
81 // Creates a new ToolbarActionsModel for the given |context|. | 81 // Creates a new ToolbarActionsModel for the given |context|. |
82 std::unique_ptr<KeyedService> BuildToolbarModel( | 82 std::unique_ptr<KeyedService> BuildToolbarModel( |
83 content::BrowserContext* context) { | 83 content::BrowserContext* context) { |
84 return base::WrapUnique( | 84 return base::MakeUnique<ToolbarActionsModel>( |
85 new ToolbarActionsModel(Profile::FromBrowserContext(context), | 85 Profile::FromBrowserContext(context), |
86 extensions::ExtensionPrefs::Get(context))); | 86 extensions::ExtensionPrefs::Get(context)); |
87 } | 87 } |
88 | 88 |
89 // Creates a new ToolbarActionsModel for the given profile, optionally | 89 // Creates a new ToolbarActionsModel for the given profile, optionally |
90 // triggering the extension system's ready signal. | 90 // triggering the extension system's ready signal. |
91 ToolbarActionsModel* CreateToolbarModelImpl(Profile* profile, | 91 ToolbarActionsModel* CreateToolbarModelImpl(Profile* profile, |
92 bool wait_for_ready) { | 92 bool wait_for_ready) { |
93 ToolbarActionsModel* model = ToolbarActionsModel::Get(profile); | 93 ToolbarActionsModel* model = ToolbarActionsModel::Get(profile); |
94 if (model) | 94 if (model) |
95 return model; | 95 return model; |
96 | 96 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 return CreateToolbarModelImpl(profile, true); | 166 return CreateToolbarModelImpl(profile, true); |
167 } | 167 } |
168 | 168 |
169 ToolbarActionsModel* CreateToolbarModelForProfileWithoutWaitingForReady( | 169 ToolbarActionsModel* CreateToolbarModelForProfileWithoutWaitingForReady( |
170 Profile* profile) { | 170 Profile* profile) { |
171 return CreateToolbarModelImpl(profile, false); | 171 return CreateToolbarModelImpl(profile, false); |
172 } | 172 } |
173 | 173 |
174 } // namespace extension_action_test_util | 174 } // namespace extension_action_test_util |
175 } // namespace extensions | 175 } // namespace extensions |
OLD | NEW |