| Index: chrome/browser/extensions/external_pref_extension_loader.cc
|
| diff --git a/chrome/browser/extensions/external_pref_extension_loader.cc b/chrome/browser/extensions/external_pref_extension_loader.cc
|
| index b1b5d473f4f59350f866a1240acf38fd70774f9e..387ae837d4a55aaa20d4a2218112e5ee4a71eba4 100644
|
| --- a/chrome/browser/extensions/external_pref_extension_loader.cc
|
| +++ b/chrome/browser/extensions/external_pref_extension_loader.cc
|
| @@ -32,10 +32,19 @@ DictionaryValue* ExtractPrefs(ValueSerializer* serializer) {
|
|
|
| } // namespace
|
|
|
| -ExternalPrefExtensionLoader::ExternalPrefExtensionLoader() {
|
| +ExternalPrefExtensionLoader::ExternalPrefExtensionLoader(int path_key)
|
| + : path_key_(path_key) {
|
| CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| }
|
|
|
| +const FilePath ExternalPrefExtensionLoader::GetBaseCrxFilePath() {
|
| + CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| +
|
| + FilePath external_file_path;
|
| + CHECK(PathService::Get(path_key_, &external_file_path));
|
| + return external_file_path;
|
| +}
|
| +
|
| void ExternalPrefExtensionLoader::StartLoading() {
|
| CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| BrowserThread::PostTask(
|
| @@ -47,11 +56,12 @@ void ExternalPrefExtensionLoader::StartLoading() {
|
|
|
| void ExternalPrefExtensionLoader::LoadOnFileThread() {
|
| CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
|
| +
|
| FilePath json_file;
|
| - PathService::Get(app::DIR_EXTERNAL_EXTENSIONS, &json_file);
|
| + CHECK(PathService::Get(path_key_, &json_file));
|
| json_file = json_file.Append(FILE_PATH_LITERAL("external_extensions.json"));
|
| - scoped_ptr<DictionaryValue> prefs;
|
|
|
| + scoped_ptr<DictionaryValue> prefs;
|
| if (file_util::PathExists(json_file)) {
|
| JSONFileValueSerializer serializer(json_file);
|
| prefs.reset(ExtractPrefs(&serializer));
|
| @@ -68,7 +78,9 @@ void ExternalPrefExtensionLoader::LoadOnFileThread() {
|
| }
|
|
|
| ExternalTestingExtensionLoader::ExternalTestingExtensionLoader(
|
| - const std::string& json_data) {
|
| + const std::string& json_data,
|
| + const FilePath& fake_base_path)
|
| + : fake_base_path_(fake_base_path) {
|
| CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| JSONStringValueSerializer serializer(json_data);
|
| testing_prefs_.reset(ExtractPrefs(&serializer));
|
| @@ -80,3 +92,7 @@ void ExternalTestingExtensionLoader::StartLoading() {
|
| static_cast<DictionaryValue*>(testing_prefs_->DeepCopy()));
|
| LoadFinished();
|
| }
|
| +
|
| +const FilePath ExternalTestingExtensionLoader::GetBaseCrxFilePath() {
|
| + return fake_base_path_;
|
| +}
|
|
|