| 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/files/file_util.h" | 9 #include "base/files/file_util.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 } | 125 } |
| 126 | 126 |
| 127 scoped_refptr<Extension> TestExtensionPrefs::AddExtension( | 127 scoped_refptr<Extension> TestExtensionPrefs::AddExtension( |
| 128 const std::string& name) { | 128 const std::string& name) { |
| 129 base::DictionaryValue dictionary; | 129 base::DictionaryValue dictionary; |
| 130 dictionary.SetString(manifest_keys::kName, name); | 130 dictionary.SetString(manifest_keys::kName, name); |
| 131 dictionary.SetString(manifest_keys::kVersion, "0.1"); | 131 dictionary.SetString(manifest_keys::kVersion, "0.1"); |
| 132 return AddExtensionWithManifest(dictionary, Manifest::INTERNAL); | 132 return AddExtensionWithManifest(dictionary, Manifest::INTERNAL); |
| 133 } | 133 } |
| 134 | 134 |
| 135 scoped_refptr<Extension> TestExtensionPrefs::AddExtensionWithManifestLocation( |
| 136 const std::string& name, |
| 137 Manifest::Location location) { |
| 138 base::DictionaryValue dictionary; |
| 139 dictionary.SetString(manifest_keys::kName, name); |
| 140 dictionary.SetString(manifest_keys::kVersion, "0.1"); |
| 141 return AddExtensionWithManifest(dictionary, location); |
| 142 } |
| 143 |
| 135 scoped_refptr<Extension> TestExtensionPrefs::AddApp(const std::string& name) { | 144 scoped_refptr<Extension> TestExtensionPrefs::AddApp(const std::string& name) { |
| 136 base::DictionaryValue dictionary; | 145 base::DictionaryValue dictionary; |
| 137 dictionary.SetString(manifest_keys::kName, name); | 146 dictionary.SetString(manifest_keys::kName, name); |
| 138 dictionary.SetString(manifest_keys::kVersion, "0.1"); | 147 dictionary.SetString(manifest_keys::kVersion, "0.1"); |
| 139 dictionary.SetString(manifest_keys::kApp, "true"); | 148 dictionary.SetString(manifest_keys::kApp, "true"); |
| 140 dictionary.SetString(manifest_keys::kLaunchWebURL, "http://example.com"); | 149 dictionary.SetString(manifest_keys::kLaunchWebURL, "http://example.com"); |
| 141 return AddExtensionWithManifest(dictionary, Manifest::INTERNAL); | 150 return AddExtensionWithManifest(dictionary, Manifest::INTERNAL); |
| 142 | 151 |
| 143 } | 152 } |
| 144 | 153 |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const { | 188 PrefService* TestExtensionPrefs::CreateIncognitoPrefService() const { |
| 180 return pref_service_->CreateIncognitoPrefService( | 189 return pref_service_->CreateIncognitoPrefService( |
| 181 new ExtensionPrefStore(extension_pref_value_map_.get(), true)); | 190 new ExtensionPrefStore(extension_pref_value_map_.get(), true)); |
| 182 } | 191 } |
| 183 | 192 |
| 184 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) { | 193 void TestExtensionPrefs::set_extensions_disabled(bool extensions_disabled) { |
| 185 extensions_disabled_ = extensions_disabled; | 194 extensions_disabled_ = extensions_disabled; |
| 186 } | 195 } |
| 187 | 196 |
| 188 } // namespace extensions | 197 } // namespace extensions |
| OLD | NEW |