Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2076)

Side by Side Diff: chrome/browser/extensions/external_component_loader.cc

Issue 1201163002: Remove hotword installation code at compile time if hotwording disabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/search/hotword_service_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/search/hotword_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698