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

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: Rebase. 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
« no previous file with comments | « chrome/browser/ui/app_list/start_page_service.cc ('k') | chrome/common/chrome_switches.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..25fd15972adcefcfe6017ce2b8ed401d9c66da21 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,13 @@ void StartPageHandler::HandleInitialize(const base::ListValue* args) {
#endif
if (!app_list::switches::IsExperimentalAppListEnabled()) {
+ // If experimental hotwording is enabled, don't enable hotwording in the
+ // start page, since the hotword extension is taking care of this.
+ bool hotword_enabled = service->HotwordEnabled() &&
+ !HotwordService::IsExperimentalHotwordingEnabled();
web_ui()->CallJavascriptFunction(
"appList.startPage.onAppListShown",
- base::FundamentalValue(service->HotwordEnabled()));
+ base::FundamentalValue(hotword_enabled));
}
}
« no previous file with comments | « chrome/browser/ui/app_list/start_page_service.cc ('k') | chrome/common/chrome_switches.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698