summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/external_component_loader.cc
diff options
context:
space:
mode:
authormukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-26 23:54:56 +0000
committermukai@chromium.org <mukai@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-02-26 23:54:56 +0000
commit3183a2fea31eabc126a1f35688504c622f8fe44a (patch)
tree9a6d754e91e112c2a244319cbcfd4c6b891577c5 /chrome/browser/extensions/external_component_loader.cc
parent721ad9878246e49890cb8aa796ced1dab88a0a92 (diff)
downloadchromium_src-3183a2fea31eabc126a1f35688504c622f8fe44a.zip
chromium_src-3183a2fea31eabc126a1f35688504c622f8fe44a.tar.gz
chromium_src-3183a2fea31eabc126a1f35688504c622f8fe44a.tar.bz2
Uses the hotword nexe from the CWS instead of the local package.
Note that it still uses its own JS handler rather than the extension's JS code. This just replaces the location of nexe and data. BUG=341716 R=xiyuan@chromium.org, miket@chromium.org, TEST=manually Review URL: https://codereview.chromium.org/173123003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253639 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/external_component_loader.cc')
-rw-r--r--chrome/browser/extensions/external_component_loader.cc19
1 files changed, 18 insertions, 1 deletions
diff --git a/chrome/browser/extensions/external_component_loader.cc b/chrome/browser/extensions/external_component_loader.cc
index 50b0a3d..2b705fb 100644
--- a/chrome/browser/extensions/external_component_loader.cc
+++ b/chrome/browser/extensions/external_component_loader.cc
@@ -18,8 +18,24 @@
#include "components/user_prefs/pref_registry_syncable.h"
#include "content/public/browser/browser_thread.h"
+#if defined(ENABLE_APP_LIST)
+#include "ui/app_list/app_list_switches.h"
+#endif
+
namespace extensions {
+namespace {
+
+bool IsAppListVoiceSearchEnabled() {
+#if defined(ENABLE_APP_LIST)
+ return app_list::switches::IsVoiceSearchEnabled();
+#else
+ return false;
+#endif
+}
+
+} // namespace
+
ExternalComponentLoader::ExternalComponentLoader(Profile* profile)
: profile_(profile) {
}
@@ -32,7 +48,8 @@ void ExternalComponentLoader::StartLoading() {
prefs_->SetString(appId + ".external_update_url",
extension_urls::GetWebstoreUpdateUrl().spec());
- if (HotwordServiceFactory::IsHotwordAllowed(profile_)) {
+ if (HotwordServiceFactory::IsHotwordAllowed(profile_) ||
+ IsAppListVoiceSearchEnabled()) {
std::string hotwordId = extension_misc::kHotwordExtensionId;
prefs_->SetString(hotwordId + ".external_update_url",
extension_urls::GetWebstoreUpdateUrl().spec());