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

Unified Diff: chrome/browser/extensions/api/hotword_audio_verification_private/hotword_audio_verification_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: 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_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

Powered by Google App Engine
This is Rietveld 408576698