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> |
| 8 |
7 #include "base/command_line.h" | 9 #include "base/command_line.h" |
8 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
9 #include "chrome/browser/extensions/blacklist.h" | 11 #include "chrome/browser/extensions/blacklist.h" |
10 #include "chrome/browser/extensions/chrome_app_sorting.h" | 12 #include "chrome/browser/extensions/chrome_app_sorting.h" |
11 #include "chrome/browser/extensions/extension_management.h" | 13 #include "chrome/browser/extensions/extension_management.h" |
12 #include "chrome/browser/extensions/extension_service.h" | 14 #include "chrome/browser/extensions/extension_service.h" |
13 #include "chrome/browser/extensions/shared_module_service.h" | 15 #include "chrome/browser/extensions/shared_module_service.h" |
14 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
16 #include "content/public/browser/browser_thread.h" | 18 #include "content/public/browser/browser_thread.h" |
(...skipping 29 matching lines...) Expand all Loading... |
46 } | 48 } |
47 | 49 |
48 ExtensionService* TestExtensionSystem::CreateExtensionService( | 50 ExtensionService* TestExtensionSystem::CreateExtensionService( |
49 const base::CommandLine* command_line, | 51 const base::CommandLine* command_line, |
50 const base::FilePath& install_directory, | 52 const base::FilePath& install_directory, |
51 bool autoupdate_enabled) { | 53 bool autoupdate_enabled) { |
52 // The ownership of |value_store_| is immediately transferred to state_store_, | 54 // The ownership of |value_store_| is immediately transferred to state_store_, |
53 // but we keep a naked pointer to the TestingValueStore. | 55 // but we keep a naked pointer to the TestingValueStore. |
54 scoped_ptr<TestingValueStore> value_store(new TestingValueStore()); | 56 scoped_ptr<TestingValueStore> value_store(new TestingValueStore()); |
55 value_store_ = value_store.get(); | 57 value_store_ = value_store.get(); |
56 state_store_.reset(new StateStore(profile_, value_store.Pass())); | 58 state_store_.reset(new StateStore(profile_, std::move(value_store))); |
57 management_policy_.reset(new ManagementPolicy()); | 59 management_policy_.reset(new ManagementPolicy()); |
58 management_policy_->RegisterProviders( | 60 management_policy_->RegisterProviders( |
59 ExtensionManagementFactory::GetForBrowserContext(profile_) | 61 ExtensionManagementFactory::GetForBrowserContext(profile_) |
60 ->GetProviders()); | 62 ->GetProviders()); |
61 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_))); | 63 runtime_data_.reset(new RuntimeData(ExtensionRegistry::Get(profile_))); |
62 extension_service_.reset(new ExtensionService(profile_, | 64 extension_service_.reset(new ExtensionService(profile_, |
63 command_line, | 65 command_line, |
64 install_directory, | 66 install_directory, |
65 ExtensionPrefs::Get(profile_), | 67 ExtensionPrefs::Get(profile_), |
66 Blacklist::Get(profile_), | 68 Blacklist::Get(profile_), |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 content::BrowserContext* profile) { | 139 content::BrowserContext* profile) { |
138 return make_scoped_ptr( | 140 return make_scoped_ptr( |
139 new TestExtensionSystem(static_cast<Profile*>(profile))); | 141 new TestExtensionSystem(static_cast<Profile*>(profile))); |
140 } | 142 } |
141 | 143 |
142 void TestExtensionSystem::RecreateAppSorting() { | 144 void TestExtensionSystem::RecreateAppSorting() { |
143 app_sorting_.reset(new ChromeAppSorting(profile_)); | 145 app_sorting_.reset(new ChromeAppSorting(profile_)); |
144 } | 146 } |
145 | 147 |
146 } // namespace extensions | 148 } // namespace extensions |
OLD | NEW |