Index: chrome/browser/extensions/api/hotword_audio_verification_private/hotword_audio_verification_private_api.cc |
diff --git a/chrome/browser/extensions/api/hotword_audio_verification_private/hotword_audio_verification_private_api.cc b/chrome/browser/extensions/api/hotword_audio_verification_private/hotword_audio_verification_private_api.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..5915bb14ba330da08962e2e6deacdbd3e184370c |
--- /dev/null |
+++ b/chrome/browser/extensions/api/hotword_audio_verification_private/hotword_audio_verification_private_api.cc |
@@ -0,0 +1,29 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/extensions/api/hotword_audio_verification_private/hotword_audio_verification_private_api.h" |
+ |
+#include "chrome/browser/profiles/profile.h" |
+#include "chrome/browser/search/hotword_service.h" |
+#include "chrome/browser/search/hotword_service_factory.h" |
+ |
+namespace extensions { |
+ |
+bool HotwordAudioVerificationPrivateGetLaunchStateFunction::RunSync() { |
+ api::hotword_audio_verification_private::LaunchState result; |
+ |
+ HotwordService* hotword_service = |
+ HotwordServiceFactory::GetForProfile(GetProfile()); |
+ // TODO(kcarattini): Do better error handling. |
benwells
2014/09/09 20:57:30
Error handling is pretty easy. You just set error_
kcarattini
2014/09/10 08:14:28
Done. I'm not sure what you mean by "the rest happ
|
+ if (!hotword_service) |
+ result.launch_mode = -1; |
+ else |
+ result.launch_mode = |
benwells
2014/09/09 20:57:30
You need {} as this is a multi-line body.
kcarattini
2014/09/10 08:14:28
Done.
|
+ hotword_service->GetHotwordAudioVerificationLaunchState(); |
+ |
+ SetResult(result.ToValue().release()); |
+ return true; |
+} |
+ |
+} // namespace extensions |