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

Unified Diff: chrome/browser/extensions/api/hotword_private/hotword_private_api.cc

Issue 631913004: Open the launcher when hotword is triggered in always-on mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@hotword-google-com-ntp
Patch Set: Created 6 years, 2 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/extensions/api/hotword_private/hotword_private_api.cc
diff --git a/chrome/browser/extensions/api/hotword_private/hotword_private_api.cc b/chrome/browser/extensions/api/hotword_private/hotword_private_api.cc
index 2de65c89c42932bd1e8bd662cb6944e222dbd711..db6db77b3068dfbd8c683b616104c4a280f135c9 100644
--- a/chrome/browser/extensions/api/hotword_private/hotword_private_api.cc
+++ b/chrome/browser/extensions/api/hotword_private/hotword_private_api.cc
@@ -11,6 +11,7 @@
#include "chrome/browser/search/hotword_client.h"
#include "chrome/browser/search/hotword_service.h"
#include "chrome/browser/search/hotword_service_factory.h"
+#include "chrome/browser/ui/app_list/app_list_service.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "extensions/browser/event_router.h"
@@ -157,8 +158,17 @@ bool HotwordPrivateSetHotwordSessionStateFunction::RunSync() {
bool HotwordPrivateNotifyHotwordRecognitionFunction::RunSync() {
HotwordService* hotword_service =
HotwordServiceFactory::GetForProfile(GetProfile());
- if (hotword_service && hotword_service->client())
- hotword_service->client()->OnHotwordRecognized();
+ if (hotword_service) {
+ if (hotword_service->client()) {
+ hotword_service->client()->OnHotwordRecognized();
+ } else if (HotwordService::IsExperimentalHotwordingEnabled() &&
+ hotword_service->IsAlwaysOnEnabled()) {
+ AppListService* app_list_service = AppListService::Get(
+ chrome::HOST_DESKTOP_TYPE_NATIVE);
tapted 2014/10/09 03:37:00 you might want AppListService::Get(GetCurrentBrows
Anand Mistry (off Chromium) 2014/10/13 21:51:59 Done. But note, priority is ChromeOS. We're not ta
+ CHECK(app_list_service);
+ app_list_service->ShowForVoiceSearch(GetProfile());
+ }
+ }
return true;
}
« no previous file with comments | « no previous file | chrome/browser/search/hotword_service.h » ('j') | chrome/browser/ui/app_list/app_list_service_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698