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 ExternalComponentLoader::ExternalComponentLoader(Profile* profile) | 34 ExternalComponentLoader::ExternalComponentLoader(Profile* profile) |
35 : profile_(profile) { | 35 : profile_(profile) { |
36 } | 36 } |
37 | 37 |
38 ExternalComponentLoader::~ExternalComponentLoader() {} | 38 ExternalComponentLoader::~ExternalComponentLoader() {} |
39 | 39 |
40 void ExternalComponentLoader::StartLoading() { | 40 void ExternalComponentLoader::StartLoading() { |
41 prefs_.reset(new base::DictionaryValue()); | 41 prefs_.reset(new base::DictionaryValue()); |
42 AddExternalExtension(extension_misc::kInAppPaymentsSupportAppId); | 42 AddExternalExtension(extension_misc::kInAppPaymentsSupportAppId); |
43 | 43 |
| 44 #if defined(ENABLE_HOTWORDING) |
44 if (HotwordServiceFactory::IsHotwordAllowed(profile_)) | 45 if (HotwordServiceFactory::IsHotwordAllowed(profile_)) |
45 AddExternalExtension(extension_misc::kHotwordSharedModuleId); | 46 AddExternalExtension(extension_misc::kHotwordSharedModuleId); |
| 47 #endif // defined(ENABLE_HOTWORDING) |
46 | 48 |
47 #if defined(OS_CHROMEOS) | 49 #if defined(OS_CHROMEOS) |
48 { | 50 { |
49 base::CommandLine* const command_line = | 51 base::CommandLine* const command_line = |
50 base::CommandLine::ForCurrentProcess(); | 52 base::CommandLine::ForCurrentProcess(); |
51 if (!command_line->HasSwitch(chromeos::switches::kDisableNewZIPUnpacker)) | 53 if (!command_line->HasSwitch(chromeos::switches::kDisableNewZIPUnpacker)) |
52 AddExternalExtension(extension_misc::kZIPUnpackerExtensionId); | 54 AddExternalExtension(extension_misc::kZIPUnpackerExtensionId); |
53 } | 55 } |
54 #endif | 56 #endif |
55 | 57 |
(...skipping 14 matching lines...) Expand all Loading... |
70 void ExternalComponentLoader::AddExternalExtension( | 72 void ExternalComponentLoader::AddExternalExtension( |
71 const std::string& extension_id) { | 73 const std::string& extension_id) { |
72 if (!IsComponentExtensionWhitelisted(extension_id)) | 74 if (!IsComponentExtensionWhitelisted(extension_id)) |
73 return; | 75 return; |
74 | 76 |
75 prefs_->SetString(extension_id + ".external_update_url", | 77 prefs_->SetString(extension_id + ".external_update_url", |
76 extension_urls::GetWebstoreUpdateUrl().spec()); | 78 extension_urls::GetWebstoreUpdateUrl().spec()); |
77 } | 79 } |
78 | 80 |
79 } // namespace extensions | 81 } // namespace extensions |
OLD | NEW |