| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ |
| 6 #define CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ | 6 #define CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 // | 139 // |
| 140 // TODO(kcarattini): Remove this when | 140 // TODO(kcarattini): Remove this when |
| 141 // https://code.google.com/p/chromium/issues/detail?id=165573 is fixed, | 141 // https://code.google.com/p/chromium/issues/detail?id=165573 is fixed, |
| 142 // at which time we can simply launch the app in the given mode instead of | 142 // at which time we can simply launch the app in the given mode instead of |
| 143 // having to check for it here. | 143 // having to check for it here. |
| 144 enum LaunchMode { | 144 enum LaunchMode { |
| 145 HOTWORD_ONLY, | 145 HOTWORD_ONLY, |
| 146 HOTWORD_AND_AUDIO_HISTORY, | 146 HOTWORD_AND_AUDIO_HISTORY, |
| 147 RETRAIN | 147 RETRAIN |
| 148 }; | 148 }; |
| 149 void OptIntoHotwording(const LaunchMode& launch_mode); |
| 149 void LaunchHotwordAudioVerificationApp(const LaunchMode& launch_mode); | 150 void LaunchHotwordAudioVerificationApp(const LaunchMode& launch_mode); |
| 150 virtual LaunchMode GetHotwordAudioVerificationLaunchMode(); | 151 virtual LaunchMode GetHotwordAudioVerificationLaunchMode(); |
| 151 | 152 |
| 153 // Called when the SpeakerModelExists request is complete. Either |
| 154 // sets the always-on hotword pref to true, or launches the Hotword |
| 155 // Audio Verification App, depending on the value of |exists|. |
| 156 void SpeakerModelExistsComplete(bool exists); |
| 157 |
| 152 // These methods control the speaker training communication between | 158 // These methods control the speaker training communication between |
| 153 // the Hotword Audio Verification App and the Hotword Extension that | 159 // the Hotword Audio Verification App and the Hotword Extension that |
| 154 // contains the NaCl module. | 160 // contains the NaCl module. |
| 155 void StartTraining(); | 161 void StartTraining(); |
| 156 void FinalizeSpeakerModel(); | 162 void FinalizeSpeakerModel(); |
| 157 void StopTraining(); | 163 void StopTraining(); |
| 158 void NotifyHotwordTriggered(); | 164 void NotifyHotwordTriggered(); |
| 159 | 165 |
| 160 // Returns true if speaker training is currently in progress. | 166 // Returns true if speaker training is currently in progress. |
| 161 bool IsTraining(); | 167 bool IsTraining(); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 226 |
| 221 // The WeakPtrFactory should be the last member, so the weak pointer | 227 // The WeakPtrFactory should be the last member, so the weak pointer |
| 222 // gets invalidated before the destructors for other members run, | 228 // gets invalidated before the destructors for other members run, |
| 223 // to avoid callbacks into a half-destroyed object. | 229 // to avoid callbacks into a half-destroyed object. |
| 224 base::WeakPtrFactory<HotwordService> weak_factory_; | 230 base::WeakPtrFactory<HotwordService> weak_factory_; |
| 225 | 231 |
| 226 DISALLOW_COPY_AND_ASSIGN(HotwordService); | 232 DISALLOW_COPY_AND_ASSIGN(HotwordService); |
| 227 }; | 233 }; |
| 228 | 234 |
| 229 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ | 235 #endif // CHROME_BROWSER_SEARCH_HOTWORD_SERVICE_H_ |
| OLD | NEW |