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

Unified Diff: chrome/browser/ui/app_list/speech_recognizer_delegate.h

Issue 676593003: Implement native speech recognition for the launcher. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Pass in WeakPtr<Delegate>. Created 6 years, 1 month 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/ui/app_list/speech_recognizer_delegate.h
diff --git a/chrome/browser/ui/app_list/speech_recognizer_delegate.h b/chrome/browser/ui/app_list/speech_recognizer_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..22969cdf492f354ace780ab852a6cc8f5badb38f
--- /dev/null
+++ b/chrome/browser/ui/app_list/speech_recognizer_delegate.h
@@ -0,0 +1,46 @@
+// 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.
+
+#ifndef CHROME_BROWSER_UI_APP_LIST_SPEECH_RECOGNIZER_DELEGATE_H_
+#define CHROME_BROWSER_UI_APP_LIST_SPEECH_RECOGNIZER_DELEGATE_H_
+
+#include <stdint.h>
+
+#include "base/strings/string16.h"
+#include "ui/app_list/speech_ui_model_observer.h"
+
+namespace content {
+class WebContents;
+}
+
+namespace app_list {
+
+// Delegate for the app list speech recognizer. All methods are called from the
+// UI thread.
+class SpeechRecognizerDelegate {
+ public:
+ // Receive a speech recognition result. |is_final| indicated whether the
+ // result is an intermediate or final result. If |is_final| is true, then the
+ // recognizer stops and no more results will be returned.
+ virtual void OnSpeechResult(const base::string16& query, bool is_final) = 0;
+
+ // Invoked regularly to indicate the average sound volume.
+ virtual void OnSpeechSoundLevelChanged(int16_t level) = 0;
+
+ // Invoked when the state of speech recognition is changed.
+ virtual void OnSpeechRecognitionStateChanged(
+ SpeechRecognitionState new_state) = 0;
+
+ // Return a WebContents that is whitelisted to use the speech recognizer.
+ // TODO(amistry): This is an implementation detail that shouldn't be
+ // necessary. Somehow, eliminate this dependency.
+ virtual content::WebContents* GetSpeechContents() = 0;
+
+ protected:
+ virtual ~SpeechRecognizerDelegate() {}
+};
+
+} // namespace app_list
+
+#endif // CHROME_BROWSER_UI_APP_LIST_SPEECH_RECOGNIZER_DELEGATE_H_
« no previous file with comments | « chrome/browser/ui/app_list/speech_recognizer_browsertest.cc ('k') | chrome/browser/ui/app_list/start_page_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698