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 c2204546421f2400d5f8b425c659d34d636e4353..d4166eb41a2911c3645e4c4e824b08f405674861 100644 |
--- a/chrome/browser/extensions/api/hotword_private/hotword_private_api.cc |
+++ b/chrome/browser/extensions/api/hotword_private/hotword_private_api.cc |
@@ -17,6 +17,10 @@ |
namespace extensions { |
+namespace hotword_private_constants { |
+const char kHotwordServiceUnavailable[] = "Hotword Service is unavailable."; |
+} // hotword_private_constants |
+ |
namespace OnEnabledChanged = |
api::hotword_private::OnEnabledChanged; |
@@ -145,4 +149,21 @@ bool HotwordPrivateNotifyHotwordRecognitionFunction::RunSync() { |
return true; |
} |
+bool HotwordPrivateGetLaunchStateFunction::RunSync() { |
+ api::hotword_private::LaunchState result; |
+ |
+ HotwordService* hotword_service = |
+ HotwordServiceFactory::GetForProfile(GetProfile()); |
+ if (!hotword_service) { |
+ error_ = hotword_private_constants::kHotwordServiceUnavailable; |
+ return false; |
+ } else { |
+ result.launch_mode = |
+ hotword_service->GetHotwordAudioVerificationLaunchMode(); |
+ } |
+ |
+ SetResult(result.ToValue().release()); |
+ return true; |
+} |
+ |
} // namespace extensions |