| 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 scoped_refptr<Extension> extension = Extension::Create( | 157 scoped_refptr<Extension> extension = Extension::Create( |
| 158 path, location, manifest, extra_flags, &errors); | 158 path, location, manifest, extra_flags, &errors); |
| 159 EXPECT_TRUE(extension.get()) << errors; | 159 EXPECT_TRUE(extension.get()) << errors; |
| 160 if (!extension.get()) | 160 if (!extension.get()) |
| 161 return NULL; | 161 return NULL; |
| 162 | 162 |
| 163 EXPECT_TRUE(Extension::IdIsValid(extension->id())); | 163 EXPECT_TRUE(Extension::IdIsValid(extension->id())); |
| 164 prefs_->OnExtensionInstalled(extension.get(), | 164 prefs_->OnExtensionInstalled(extension.get(), |
| 165 Extension::ENABLED, | 165 Extension::ENABLED, |
| 166 false, | 166 false, |
| 167 syncer::StringOrdinal::CreateInitialOrdinal()); | 167 syncer::StringOrdinal::CreateInitialOrdinal(), |
| 168 std::string()); |
| 168 return extension; | 169 return extension; |
| 169 } | 170 } |
| 170 | 171 |
| 171 std::string TestExtensionPrefs::AddExtensionAndReturnId(std::string name) { | 172 std::string TestExtensionPrefs::AddExtensionAndReturnId(std::string name) { |
| 172 scoped_refptr<Extension> extension(AddExtension(name)); | 173 scoped_refptr<Extension> extension(AddExtension(name)); |
| 173 return extension->id(); | 174 return extension->id(); |
| 174 } | 175 } |
| 175 | 176 |
| 176 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const { | 177 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const { |
| 177 return pref_service_->CreateIncognitoPrefService( | 178 return pref_service_->CreateIncognitoPrefService( |
| 178 new ExtensionPrefStore(extension_pref_value_map_.get(), true)); | 179 new ExtensionPrefStore(extension_pref_value_map_.get(), true)); |
| 179 } | 180 } |
| 180 | 181 |
| 181 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) { | 182 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) { |
| 182 extensions_disabled_ = extensions_disabled; | 183 extensions_disabled_ = extensions_disabled; |
| 183 } | 184 } |
| 184 | 185 |
| 185 } // namespace extensions | 186 } // namespace extensions |
| OLD | NEW |