OLD | NEW |
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/context_utils.h" | 9 #include "base/android/context_utils.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
13 #include "chrome/browser/speech/tts_controller.h" | 13 #include "chrome/browser/speech/tts_controller.h" |
14 #include "chrome/common/features.h" | 14 #include "chrome/common/features.h" |
15 #include "jni/TtsPlatformImpl_jni.h" | 15 #include "jni/TtsPlatformImpl_jni.h" |
16 | 16 |
17 using base::android::AttachCurrentThread; | 17 using base::android::AttachCurrentThread; |
| 18 using base::android::JavaParamRef; |
18 | 19 |
19 // static | 20 // static |
20 TtsPlatformImpl* TtsPlatformImpl::GetInstance() { | 21 TtsPlatformImpl* TtsPlatformImpl::GetInstance() { |
21 return TtsPlatformImplAndroid::GetInstance(); | 22 return TtsPlatformImplAndroid::GetInstance(); |
22 } | 23 } |
23 | 24 |
24 TtsPlatformImplAndroid::TtsPlatformImplAndroid() | 25 TtsPlatformImplAndroid::TtsPlatformImplAndroid() |
25 : utterance_id_(0) { | 26 : utterance_id_(0) { |
26 JNIEnv* env = AttachCurrentThread(); | 27 JNIEnv* env = AttachCurrentThread(); |
27 java_ref_.Reset( | 28 java_ref_.Reset( |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 TtsPlatformImplAndroid* TtsPlatformImplAndroid::GetInstance() { | 144 TtsPlatformImplAndroid* TtsPlatformImplAndroid::GetInstance() { |
144 return base::Singleton< | 145 return base::Singleton< |
145 TtsPlatformImplAndroid, | 146 TtsPlatformImplAndroid, |
146 base::LeakySingletonTraits<TtsPlatformImplAndroid>>::get(); | 147 base::LeakySingletonTraits<TtsPlatformImplAndroid>>::get(); |
147 } | 148 } |
148 | 149 |
149 // static | 150 // static |
150 bool TtsPlatformImplAndroid::Register(JNIEnv* env) { | 151 bool TtsPlatformImplAndroid::Register(JNIEnv* env) { |
151 return RegisterNativesImpl(env); | 152 return RegisterNativesImpl(env); |
152 } | 153 } |
OLD | NEW |