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

Unified Diff: chrome/browser/extensions/api/hotword_private/hotword_private_api.cc

Issue 528113003: Hotword Audio Verification App: Adds to hotwordPrivate API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@page-one
Patch Set: Rebase Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698