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

Side by Side Diff: chrome/browser/speech/tts_android.h

Issue 15012027: Android implementation of text-to-speech code for Web Speech Synthesis API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tts_multivoice
Patch Set: Address feedback Created 7 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_SPEECH_TTS_ANDROID_H_
6 #define CHROME_BROWSER_SPEECH_TTS_ANDROID_H_
7
8 #include "base/android/jni_android.h"
9 #include "base/android/scoped_java_ref.h"
10 #include "chrome/browser/speech/tts_platform.h"
11
12 class TtsPlatformImplAndroid : public TtsPlatformImpl {
13 public:
14 virtual bool PlatformImplAvailable() OVERRIDE {
15 return true;
16 }
17
bulach 2013/05/16 11:10:28 nit: // TtsPlatformImpl methods: also, could do w
dmazzoni 2013/05/16 16:36:40 Done.
18 virtual bool Speak(
19 int utterance_id,
20 const std::string& utterance,
21 const std::string& lang,
22 const VoiceData& voice,
23 const UtteranceContinuousParameters& params) OVERRIDE;
24
25 virtual bool StopSpeaking() OVERRIDE;
26
27 virtual bool IsSpeaking() OVERRIDE;
28
29 virtual void GetVoices(std::vector<VoiceData>* out_voices) OVERRIDE;
30
31 //
32 // Methods called from Java via JNI.
33 //
bulach 2013/05/16 11:10:28 nit: maybe remove the extra // here and 40-42 belo
dmazzoni 2013/05/16 16:36:40 Done.
34
35 void VoicesChanged(JNIEnv* env, jobject obj);
36 void OnEndEvent(JNIEnv* env, jobject obj, jint utterance_id);
37 void OnErrorEvent(JNIEnv* env, jobject obj, jint utterance_id);
38 void OnStartEvent(JNIEnv* env, jobject obj, jint utterance_id);
39
40 //
41 // Static functions.
42 //
43
44 // Get the single instance of this class.
45 static TtsPlatformImplAndroid* GetInstance();
46
47 static bool Register(JNIEnv* env);
48
49 private:
50 TtsPlatformImplAndroid();
51 virtual ~TtsPlatformImplAndroid();
52
53 base::android::ScopedJavaGlobalRef<jobject> java_ref_;
54 int utterance_id_;
55 std::string utterance_;
56
57 friend struct DefaultSingletonTraits<TtsPlatformImplAndroid>;
bulach 2013/05/16 11:10:28 nit: friend decl should go right after the private
dmazzoni 2013/05/16 16:36:40 Done.
58
59 DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplAndroid);
60 };
61
62
bulach 2013/05/16 11:10:28 nit: remove extra \n
dmazzoni 2013/05/16 16:36:40 Done.
63
64 #endif // CHROME_BROWSER_SPEECH_TTS_ANDROID_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698