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

Side by Side Diff: chrome/browser/search/hotword_service.cc

Issue 1027683002: Hotword Private API: Add function and event to query the existence of a speaker model (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Upload remaining test files Created 5 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/search/hotword_service.h" 5 #include "chrome/browser/search/hotword_service.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/case_conversion.h" 10 #include "base/i18n/case_conversion.h"
(...skipping 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 void HotwordService::OptIntoHotwording( 737 void HotwordService::OptIntoHotwording(
738 const LaunchMode& launch_mode) { 738 const LaunchMode& launch_mode) {
739 // First determine if we actually need to launch the app, or can just enable 739 // First determine if we actually need to launch the app, or can just enable
740 // the pref. If Audio History has already been enabled, and we already have 740 // the pref. If Audio History has already been enabled, and we already have
741 // a speaker model, then we don't need to launch the app at all. 741 // a speaker model, then we don't need to launch the app at all.
742 if (launch_mode == HotwordService::HOTWORD_ONLY) { 742 if (launch_mode == HotwordService::HOTWORD_ONLY) {
743 HotwordPrivateEventService* event_service = 743 HotwordPrivateEventService* event_service =
744 BrowserContextKeyedAPIFactory<HotwordPrivateEventService>::Get( 744 BrowserContextKeyedAPIFactory<HotwordPrivateEventService>::Get(
745 profile_); 745 profile_);
746 if (event_service) { 746 if (event_service) {
747 // TODO(kcarattini): add this call once it's implemented in the API. 747 event_service->OnSpeakerModelExists();
748 // event_service->SpeakerModelExists();
749 return; 748 return;
750 } 749 }
751 } 750 }
752 751
753 LaunchHotwordAudioVerificationApp(launch_mode); 752 LaunchHotwordAudioVerificationApp(launch_mode);
754 } 753 }
755 754
756 void HotwordService::LaunchHotwordAudioVerificationApp( 755 void HotwordService::LaunchHotwordAudioVerificationApp(
757 const LaunchMode& launch_mode) { 756 const LaunchMode& launch_mode) {
758 hotword_audio_verification_launch_mode_ = launch_mode; 757 hotword_audio_verification_launch_mode_ = launch_mode;
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 // Only support multiple profiles and profile switching in ChromeOS. 932 // Only support multiple profiles and profile switching in ChromeOS.
934 if (user_manager::UserManager::IsInitialized()) { 933 if (user_manager::UserManager::IsInitialized()) {
935 user_manager::User* user = 934 user_manager::User* user =
936 user_manager::UserManager::Get()->GetActiveUser(); 935 user_manager::UserManager::Get()->GetActiveUser();
937 if (user && user->is_profile_created()) 936 if (user && user->is_profile_created())
938 return profile_ == ProfileManager::GetActiveUserProfile(); 937 return profile_ == ProfileManager::GetActiveUserProfile();
939 } 938 }
940 #endif 939 #endif
941 return true; 940 return true;
942 } 941 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698