| Index: chrome/browser/search/hotword_service.cc
|
| diff --git a/chrome/browser/search/hotword_service.cc b/chrome/browser/search/hotword_service.cc
|
| index 0fa9d0ddbc1eceff46bf0d68cb275b98bddef93e..6381d377370d6923e2bd2badcdb28baecca1a6a3 100644
|
| --- a/chrome/browser/search/hotword_service.cc
|
| +++ b/chrome/browser/search/hotword_service.cc
|
| @@ -704,6 +704,34 @@ void HotwordService::DisableHotwordExtension(
|
| }
|
| }
|
|
|
| +void HotwordService::SpeakerModelExistsComplete(bool exists) {
|
| + if (exists) {
|
| + profile_->GetPrefs()->
|
| + SetBoolean(prefs::kHotwordAlwaysOnSearchEnabled, true);
|
| + } else {
|
| + LaunchHotwordAudioVerificationApp(HotwordService::HOTWORD_ONLY);
|
| + }
|
| +}
|
| +
|
| +void HotwordService::MaybeLaunchHotwordAudioVerificationApp(
|
| + const LaunchMode& launch_mode) {
|
| + // First determine if we actually need to launch the app, or can just enable
|
| + // the pref. If Audio History has already been enabled, and we already have
|
| + // a speaker model, then we don't need to launch the app at all.
|
| + if (launch_mode == HotwordService::HOTWORD_ONLY) {
|
| + HotwordPrivateEventService* event_service =
|
| + BrowserContextKeyedAPIFactory<HotwordPrivateEventService>::Get(
|
| + profile_);
|
| + if (event_service) {
|
| + // TODO(kcarattini): add this call once it's implemented in the API.
|
| + // event_service->SpeakerModelExists();
|
| + return;
|
| + }
|
| + }
|
| +
|
| + LaunchHotwordAudioVerificationApp(launch_mode);
|
| +}
|
| +
|
| void HotwordService::LaunchHotwordAudioVerificationApp(
|
| const LaunchMode& launch_mode) {
|
| hotword_audio_verification_launch_mode_ = launch_mode;
|
|
|