Index: chrome/browser/search/hotword_service.cc |
diff --git a/chrome/browser/search/hotword_service.cc b/chrome/browser/search/hotword_service.cc |
index f12ef059c4b7384b4f1a159e0a961b94ac319364..da2eedaa075d8c3b1ff66cb25f91170697d81bf1 100644 |
--- a/chrome/browser/search/hotword_service.cc |
+++ b/chrome/browser/search/hotword_service.cc |
@@ -453,20 +453,30 @@ void HotwordService::DisableHotwordExtension( |
void HotwordService::OnHotwordAlwaysOnSearchEnabledChanged( |
const std::string& pref_name) { |
DCHECK_EQ(pref_name, std::string(prefs::kHotwordAlwaysOnSearchEnabled)); |
+ // TODO(kcarattini): Launch in the appropriate mode given the state of |
+ // the account-level Audio History setting. |
+ LaunchHotwordAudioVerificationApp(HOTWORD_AND_AUDIO_HISTORY); |
+} |
+ |
+void HotwordService::LaunchHotwordAudioVerificationApp( |
+ const LaunchMode& launch_mode) { |
+ hotword_audio_verification_launch_mode_ = launch_mode; |
ExtensionService* extension_service = GetExtensionService(profile_); |
if (!extension_service) |
return; |
- |
const extensions::Extension* extension = extension_service->GetExtensionById( |
extension_misc::kHotwordAudioVerificationAppId, true); |
if (!extension) |
return; |
- if (profile_->GetPrefs()->GetBoolean(prefs::kHotwordAlwaysOnSearchEnabled)) { |
- OpenApplication(AppLaunchParams( |
- profile_, extension, extensions::LAUNCH_CONTAINER_WINDOW, NEW_WINDOW)); |
- } |
+ OpenApplication(AppLaunchParams( |
rpetterson
2014/09/10 23:04:23
Why don't you check if the pref is enabled any mor
kcarattini
2014/09/11 00:08:30
I don't think this is the final behaviour we want
rpetterson
2014/09/11 17:43:54
Got it. So only enable it if they've done the veri
kcarattini
2014/09/11 23:32:50
Yes, that's the idea.
|
+ profile_, extension, extensions::LAUNCH_CONTAINER_WINDOW, NEW_WINDOW)); |
+} |
+ |
+HotwordService::LaunchMode |
+HotwordService::GetHotwordAudioVerificationLaunchMode() { |
+ return hotword_audio_verification_launch_mode_; |
} |
void HotwordService::OnHotwordSearchEnabledChanged( |