| 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 "base/sha1.h" | 8 #include "base/sha1.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" | 10 #include "chrome/browser/bookmarks/enhanced_bookmarks_features.h" |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 void ExternalComponentLoader::StartLoading() { | 44 void ExternalComponentLoader::StartLoading() { |
| 45 prefs_.reset(new base::DictionaryValue()); | 45 prefs_.reset(new base::DictionaryValue()); |
| 46 std::string appId = extension_misc::kInAppPaymentsSupportAppId; | 46 std::string appId = extension_misc::kInAppPaymentsSupportAppId; |
| 47 prefs_->SetString(appId + ".external_update_url", | 47 prefs_->SetString(appId + ".external_update_url", |
| 48 extension_urls::GetWebstoreUpdateUrl().spec()); | 48 extension_urls::GetWebstoreUpdateUrl().spec()); |
| 49 | 49 |
| 50 if (HotwordServiceFactory::IsHotwordAllowed(profile_)) { | 50 if (HotwordServiceFactory::IsHotwordAllowed(profile_)) { |
| 51 std::string hotwordId = extension_misc::kHotwordExtensionId; | 51 std::string hotwordId = extension_misc::kHotwordExtensionId; |
| 52 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 52 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 53 // TODO(amistry): Load the hotword shared module when enabling built-in | 53 if (command_line->HasSwitch(switches::kEnableExperimentalHotwording)) { |
| 54 // hotword detection. | 54 hotwordId = extension_misc::kHotwordSharedModuleId; |
| 55 if (!command_line->HasSwitch(switches::kEnableExperimentalHotwording)) { | |
| 56 prefs_->SetString(hotwordId + ".external_update_url", | |
| 57 extension_urls::GetWebstoreUpdateUrl().spec()); | |
| 58 } | 55 } |
| 56 prefs_->SetString(hotwordId + ".external_update_url", |
| 57 extension_urls::GetWebstoreUpdateUrl().spec()); |
| 59 } | 58 } |
| 60 | 59 |
| 61 InitBookmarksExperimentState(profile_); | 60 InitBookmarksExperimentState(profile_); |
| 62 | 61 |
| 63 std::string ext_id; | 62 std::string ext_id; |
| 64 if (GetBookmarksExperimentExtensionID(profile_->GetPrefs(), &ext_id) && | 63 if (GetBookmarksExperimentExtensionID(profile_->GetPrefs(), &ext_id) && |
| 65 !ext_id.empty()) { | 64 !ext_id.empty()) { |
| 66 prefs_->SetString(ext_id + ".external_update_url", | 65 prefs_->SetString(ext_id + ".external_update_url", |
| 67 extension_urls::GetWebstoreUpdateUrl().spec()); | 66 extension_urls::GetWebstoreUpdateUrl().spec()); |
| 68 } | 67 } |
| 69 | 68 |
| 70 LoadFinished(); | 69 LoadFinished(); |
| 71 } | 70 } |
| 72 | 71 |
| 73 } // namespace extensions | 72 } // namespace extensions |
| OLD | NEW |