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

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

Issue 15108002: Add Pause and Resume to Web TTS & Extension TTS APIs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/speech/tts_android.h ('k') | chrome/browser/speech/tts_chromeos.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/speech/tts_android.h" 5 #include "chrome/browser/speech/tts_android.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 } 62 }
63 63
64 bool TtsPlatformImplAndroid::StopSpeaking() { 64 bool TtsPlatformImplAndroid::StopSpeaking() {
65 JNIEnv* env = AttachCurrentThread(); 65 JNIEnv* env = AttachCurrentThread();
66 Java_TtsPlatformImpl_stop(env, java_ref_.obj()); 66 Java_TtsPlatformImpl_stop(env, java_ref_.obj());
67 utterance_id_ = 0; 67 utterance_id_ = 0;
68 utterance_.clear(); 68 utterance_.clear();
69 return true; 69 return true;
70 } 70 }
71 71
72 void TtsPlatformImplAndroid::Pause() {
73 StopSpeaking();
74 }
75
76 void TtsPlatformImplAndroid::Resume() {
77 }
78
72 bool TtsPlatformImplAndroid::IsSpeaking() { 79 bool TtsPlatformImplAndroid::IsSpeaking() {
73 return (utterance_id_ != 0); 80 return (utterance_id_ != 0);
74 } 81 }
75 82
76 void TtsPlatformImplAndroid::GetVoices( 83 void TtsPlatformImplAndroid::GetVoices(
77 std::vector<VoiceData>* out_voices) { 84 std::vector<VoiceData>* out_voices) {
78 JNIEnv* env = AttachCurrentThread(); 85 JNIEnv* env = AttachCurrentThread();
79 if (!Java_TtsPlatformImpl_isInitialized(env, java_ref_.obj())) 86 if (!Java_TtsPlatformImpl_isInitialized(env, java_ref_.obj()))
80 return; 87 return;
81 88
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 139
133 // static 140 // static
134 TtsPlatformImplAndroid* TtsPlatformImplAndroid::GetInstance() { 141 TtsPlatformImplAndroid* TtsPlatformImplAndroid::GetInstance() {
135 return Singleton<TtsPlatformImplAndroid>::get(); 142 return Singleton<TtsPlatformImplAndroid>::get();
136 } 143 }
137 144
138 // static 145 // static
139 bool TtsPlatformImplAndroid::Register(JNIEnv* env) { 146 bool TtsPlatformImplAndroid::Register(JNIEnv* env) {
140 return RegisterNativesImpl(env); 147 return RegisterNativesImpl(env);
141 } 148 }
OLDNEW
« no previous file with comments | « chrome/browser/speech/tts_android.h ('k') | chrome/browser/speech/tts_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698