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

Unified Diff: chrome/browser/ui/webui/app_list/start_page_handler.cc

Issue 471853002: Use the new hotword extension in the launcher when it is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/app_list/start_page_handler.cc
diff --git a/chrome/browser/ui/webui/app_list/start_page_handler.cc b/chrome/browser/ui/webui/app_list/start_page_handler.cc
index 76ebc29041a8c61935a2a53b6b754b2010710315..1ff81857773922f5199041f8f1d0cfd9cb6b0b20 100644
--- a/chrome/browser/ui/webui/app_list/start_page_handler.cc
+++ b/chrome/browser/ui/webui/app_list/start_page_handler.cc
@@ -144,7 +144,8 @@ void StartPageHandler::OnHotwordEnabledChanged() {
extensions::ExtensionRegistry::ENABLED);
if (hotword_extension &&
hotword_extension->version()->CompareTo(
- base::Version(kOldHotwordExtensionVersionString)) <= 0) {
+ base::Version(kOldHotwordExtensionVersionString)) <= 0 &&
+ !HotwordService::IsExperimentalHotwordingEnabled()) {
StartPageService* service = StartPageService::Get(profile);
web_ui()->CallJavascriptFunction(
"appList.startPage.setHotwordEnabled",
@@ -193,9 +194,14 @@ void StartPageHandler::HandleInitialize(const base::ListValue* args) {
#endif
if (!app_list::switches::IsExperimentalAppListEnabled()) {
+ bool hotwordEnabled = service->HotwordEnabled();
Jun Mukai 2014/08/14 22:10:08 variable name style
Anand Mistry (off Chromium) 2014/08/15 00:14:51 Done.
+ // If experimental hotwording is enabled, don't enable hotwording in the
+ // start page, since the hotword extension is taking care of this.
+ if (HotwordService::IsExperimentalHotwordingEnabled())
+ hotwordEnabled = false;
web_ui()->CallJavascriptFunction(
"appList.startPage.onAppListShown",
- base::FundamentalValue(service->HotwordEnabled()));
+ base::FundamentalValue(hotwordEnabled));
}
}

Powered by Google App Engine
This is Rietveld 408576698