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