| 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_prefs.h" | 5 #include "chrome/browser/extensions/test_extension_prefs.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 prefs_.reset(ExtensionPrefs::Create( | 114 prefs_.reset(ExtensionPrefs::Create( |
| 115 pref_service_.get(), | 115 pref_service_.get(), |
| 116 temp_dir_.path(), | 116 temp_dir_.path(), |
| 117 extension_pref_value_map_.get(), | 117 extension_pref_value_map_.get(), |
| 118 ExtensionsBrowserClient::Get()->CreateAppSorting().Pass(), | 118 ExtensionsBrowserClient::Get()->CreateAppSorting().Pass(), |
| 119 extensions_disabled_, | 119 extensions_disabled_, |
| 120 // Guarantee that no two extensions get the same installation time | 120 // Guarantee that no two extensions get the same installation time |
| 121 // stamp and we can reliably assert the installation order in the tests. | 121 // stamp and we can reliably assert the installation order in the tests. |
| 122 scoped_ptr<ExtensionPrefs::TimeProvider>( | 122 scoped_ptr<ExtensionPrefs::TimeProvider>( |
| 123 new IncrementalTimeProvider()))); | 123 new IncrementalTimeProvider()))); |
| 124 prefs_->Initialize(); |
| 124 } | 125 } |
| 125 | 126 |
| 126 scoped_refptr<Extension> TestExtensionPrefs::AddExtension(std::string name) { | 127 scoped_refptr<Extension> TestExtensionPrefs::AddExtension(std::string name) { |
| 127 base::DictionaryValue dictionary; | 128 base::DictionaryValue dictionary; |
| 128 dictionary.SetString(manifest_keys::kName, name); | 129 dictionary.SetString(manifest_keys::kName, name); |
| 129 dictionary.SetString(manifest_keys::kVersion, "0.1"); | 130 dictionary.SetString(manifest_keys::kVersion, "0.1"); |
| 130 return AddExtensionWithManifest(dictionary, Manifest::INTERNAL); | 131 return AddExtensionWithManifest(dictionary, Manifest::INTERNAL); |
| 131 } | 132 } |
| 132 | 133 |
| 133 scoped_refptr<Extension> TestExtensionPrefs::AddApp(std::string name) { | 134 scoped_refptr<Extension> TestExtensionPrefs::AddApp(std::string name) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const { | 178 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const { |
| 178 return pref_service_->CreateIncognitoPrefService( | 179 return pref_service_->CreateIncognitoPrefService( |
| 179 new ExtensionPrefStore(extension_pref_value_map_.get(), true)); | 180 new ExtensionPrefStore(extension_pref_value_map_.get(), true)); |
| 180 } | 181 } |
| 181 | 182 |
| 182 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) { | 183 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) { |
| 183 extensions_disabled_ = extensions_disabled; | 184 extensions_disabled_ = extensions_disabled; |
| 184 } | 185 } |
| 185 | 186 |
| 186 } // namespace extensions | 187 } // namespace extensions |
| OLD | NEW |