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

Side by Side Diff: content/browser/speech/speech_recognizer.h

Issue 15907012: Implement SpeechRecognizerImplAndroid (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Convert error codes in Java, refactor *{,JNI} methods into single methods, nits Created 7 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_ 5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_
6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_ 6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "content/common/content_export.h"
9 10
10 namespace content { 11 namespace content {
11 12
12 class SpeechRecognitionEventListener; 13 class SpeechRecognitionEventListener;
13 14
14 // Handles speech recognition for a session (identified by |session_id|). 15 // Handles speech recognition for a session (identified by |session_id|).
15 class CONTENT_EXPORT SpeechRecognizer 16 class CONTENT_EXPORT SpeechRecognizer
16 : public base::RefCountedThreadSafe<SpeechRecognizer> { 17 : public base::RefCountedThreadSafe<SpeechRecognizer> {
17 public: 18 public:
18 19
19 SpeechRecognizer(SpeechRecognitionEventListener* listener, int session_id) 20 SpeechRecognizer(SpeechRecognitionEventListener* listener, int session_id)
20 : listener_(listener), session_id_(session_id) {} 21 : listener_(listener), session_id_(session_id) {}
21 22
22 virtual void StartRecognition() = 0; 23 virtual void StartRecognition() = 0;
23 virtual void AbortRecognition() = 0; 24 virtual void AbortRecognition() = 0;
24 virtual void StopAudioCapture() = 0; 25 virtual void StopAudioCapture() = 0;
25 virtual bool IsActive() const = 0; 26 virtual bool IsActive() const = 0;
26 virtual bool IsCapturingAudio() const = 0; 27 virtual bool IsCapturingAudio() const = 0;
27 28
28 protected: 29 protected:
30 virtual ~SpeechRecognizer() {}
31 SpeechRecognitionEventListener* listener() const { return listener_; }
32 int session_id() const { return session_id_; }
33
34 private:
29 friend class base::RefCountedThreadSafe<SpeechRecognizer>; 35 friend class base::RefCountedThreadSafe<SpeechRecognizer>;
Primiano Tucci (use gerrit) 2013/06/11 13:34:51 Nit: Was the move of friend classs.... under priva
janx 2013/06/12 14:47:14 Moved to protected.
30 36
31 virtual ~SpeechRecognizer() {}
32
33 SpeechRecognitionEventListener* listener_; 37 SpeechRecognitionEventListener* listener_;
34 int session_id_; 38 int session_id_;
35 39
36 DISALLOW_COPY_AND_ASSIGN(SpeechRecognizer); 40 DISALLOW_COPY_AND_ASSIGN(SpeechRecognizer);
37 }; 41 };
38 42
39 } // namespace content 43 } // namespace content
40 44
41 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_ 45 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNIZER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698