OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/test_extension_system.h" | 5 #include "chrome/browser/extensions/test_extension_system.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/memory/ptr_util.h" |
10 #include "chrome/browser/extensions/blacklist.h" | 11 #include "chrome/browser/extensions/blacklist.h" |
11 #include "chrome/browser/extensions/chrome_app_sorting.h" | 12 #include "chrome/browser/extensions/chrome_app_sorting.h" |
12 #include "chrome/browser/extensions/extension_management.h" | 13 #include "chrome/browser/extensions/extension_management.h" |
13 #include "chrome/browser/extensions/extension_service.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
14 #include "chrome/browser/extensions/shared_module_service.h" | 15 #include "chrome/browser/extensions/shared_module_service.h" |
15 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
17 #include "components/prefs/pref_service.h" | 18 #include "components/prefs/pref_service.h" |
18 #include "content/public/browser/browser_thread.h" | 19 #include "content/public/browser/browser_thread.h" |
19 #include "extensions/browser/extension_prefs.h" | 20 #include "extensions/browser/extension_prefs.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 } | 118 } |
118 | 119 |
119 const OneShotEvent& TestExtensionSystem::ready() const { | 120 const OneShotEvent& TestExtensionSystem::ready() const { |
120 return ready_; | 121 return ready_; |
121 } | 122 } |
122 | 123 |
123 ContentVerifier* TestExtensionSystem::content_verifier() { | 124 ContentVerifier* TestExtensionSystem::content_verifier() { |
124 return NULL; | 125 return NULL; |
125 } | 126 } |
126 | 127 |
127 scoped_ptr<ExtensionSet> TestExtensionSystem::GetDependentExtensions( | 128 std::unique_ptr<ExtensionSet> TestExtensionSystem::GetDependentExtensions( |
128 const Extension* extension) { | 129 const Extension* extension) { |
129 return extension_service()->shared_module_service()->GetDependentExtensions( | 130 return extension_service()->shared_module_service()->GetDependentExtensions( |
130 extension); | 131 extension); |
131 } | 132 } |
132 | 133 |
133 void TestExtensionSystem::InstallUpdate(const std::string& extension_id, | 134 void TestExtensionSystem::InstallUpdate(const std::string& extension_id, |
134 const base::FilePath& temp_dir) { | 135 const base::FilePath& temp_dir) { |
135 NOTREACHED(); | 136 NOTREACHED(); |
136 } | 137 } |
137 | 138 |
138 TestingValueStore* TestExtensionSystem::value_store() { | 139 TestingValueStore* TestExtensionSystem::value_store() { |
139 // These tests use TestingValueStore in a way that ensures it only ever mints | 140 // These tests use TestingValueStore in a way that ensures it only ever mints |
140 // instances of TestingValueStore. | 141 // instances of TestingValueStore. |
141 return static_cast<TestingValueStore*>(store_factory_->LastCreatedStore()); | 142 return static_cast<TestingValueStore*>(store_factory_->LastCreatedStore()); |
142 } | 143 } |
143 | 144 |
144 // static | 145 // static |
145 scoped_ptr<KeyedService> TestExtensionSystem::Build( | 146 std::unique_ptr<KeyedService> TestExtensionSystem::Build( |
146 content::BrowserContext* profile) { | 147 content::BrowserContext* profile) { |
147 return make_scoped_ptr( | 148 return base::WrapUnique( |
148 new TestExtensionSystem(static_cast<Profile*>(profile))); | 149 new TestExtensionSystem(static_cast<Profile*>(profile))); |
149 } | 150 } |
150 | 151 |
151 void TestExtensionSystem::RecreateAppSorting() { | 152 void TestExtensionSystem::RecreateAppSorting() { |
152 app_sorting_.reset(new ChromeAppSorting(profile_)); | 153 app_sorting_.reset(new ChromeAppSorting(profile_)); |
153 } | 154 } |
154 | 155 |
155 } // namespace extensions | 156 } // namespace extensions |
OLD | NEW |