| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/external_component_loader.h" | 5 #include "chrome/browser/extensions/external_component_loader.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/extensions/component_extensions_whitelist/whitelist.h" | 10 #include "chrome/browser/extensions/component_extensions_whitelist/whitelist.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 namespace extensions { | 34 namespace extensions { |
| 35 | 35 |
| 36 ExternalComponentLoader::ExternalComponentLoader(Profile* profile) | 36 ExternalComponentLoader::ExternalComponentLoader(Profile* profile) |
| 37 : profile_(profile) { | 37 : profile_(profile) { |
| 38 } | 38 } |
| 39 | 39 |
| 40 ExternalComponentLoader::~ExternalComponentLoader() {} | 40 ExternalComponentLoader::~ExternalComponentLoader() {} |
| 41 | 41 |
| 42 void ExternalComponentLoader::StartLoading() { | 42 void ExternalComponentLoader::StartLoading() { |
| 43 prefs_.reset(new base::DictionaryValue()); | 43 prefs_.reset(new base::DictionaryValue()); |
| 44 #if defined(GOOGLE_CHROME_BUILD) |
| 44 AddExternalExtension(extension_misc::kInAppPaymentsSupportAppId); | 45 AddExternalExtension(extension_misc::kInAppPaymentsSupportAppId); |
| 46 #endif // defined(GOOGLE_CHROME_BUILD) |
| 45 | 47 |
| 46 if (HotwordServiceFactory::IsHotwordAllowed(profile_)) | 48 if (HotwordServiceFactory::IsHotwordAllowed(profile_)) |
| 47 AddExternalExtension(extension_misc::kHotwordSharedModuleId); | 49 AddExternalExtension(extension_misc::kHotwordSharedModuleId); |
| 48 | 50 |
| 49 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
| 50 { | 52 { |
| 51 base::CommandLine* const command_line = | 53 base::CommandLine* const command_line = |
| 52 base::CommandLine::ForCurrentProcess(); | 54 base::CommandLine::ForCurrentProcess(); |
| 53 if (!command_line->HasSwitch(chromeos::switches::kDisableNewZIPUnpacker)) | 55 if (!command_line->HasSwitch(chromeos::switches::kDisableNewZIPUnpacker)) |
| 54 AddExternalExtension(extension_misc::kZIPUnpackerExtensionId); | 56 AddExternalExtension(extension_misc::kZIPUnpackerExtensionId); |
| (...skipping 19 matching lines...) Expand all Loading... |
| 74 void ExternalComponentLoader::AddExternalExtension( | 76 void ExternalComponentLoader::AddExternalExtension( |
| 75 const std::string& extension_id) { | 77 const std::string& extension_id) { |
| 76 if (!IsComponentExtensionWhitelisted(extension_id)) | 78 if (!IsComponentExtensionWhitelisted(extension_id)) |
| 77 return; | 79 return; |
| 78 | 80 |
| 79 prefs_->SetString(extension_id + ".external_update_url", | 81 prefs_->SetString(extension_id + ".external_update_url", |
| 80 extension_urls::GetWebstoreUpdateUrl().spec()); | 82 extension_urls::GetWebstoreUpdateUrl().spec()); |
| 81 } | 83 } |
| 82 | 84 |
| 83 } // namespace extensions | 85 } // namespace extensions |
| OLD | NEW |