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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 1002473003: Expose text track settings in Content and implement for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix CQ Issues Created 5 years, 9 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 "content/browser/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
1230 composition_end, 1230 composition_end,
1231 show_ime_if_needed, 1231 show_ime_if_needed,
1232 is_non_ime_change); 1232 is_non_ime_change);
1233 } 1233 }
1234 1234
1235 void ContentViewCoreImpl::SetAccessibilityEnabled(JNIEnv* env, jobject obj, 1235 void ContentViewCoreImpl::SetAccessibilityEnabled(JNIEnv* env, jobject obj,
1236 bool enabled) { 1236 bool enabled) {
1237 SetAccessibilityEnabledInternal(enabled); 1237 SetAccessibilityEnabledInternal(enabled);
1238 } 1238 }
1239 1239
1240 void ContentViewCoreImpl::SetTextTrackSettings(JNIEnv* env,
1241 jobject obj,
1242 jstring textTrackBackgroundColor,
1243 jstring textTrackFontFamily,
1244 jstring textTrackFontStyle,
1245 jstring textTrackFontVariant,
1246 jstring textTrackTextColor,
1247 jstring textTrackTextShadow,
1248 jstring textTrackTextSize) {
1249 FrameMsg_TextTrackSettings_Params params;
1250 params.text_track_background_color = ConvertJavaStringToUTF8(
1251 env, textTrackBackgroundColor);
1252 params.text_track_font_family = ConvertJavaStringToUTF8(
1253 env, textTrackFontFamily);
1254 params.text_track_font_style = ConvertJavaStringToUTF8(
1255 env, textTrackFontStyle);
1256 params.text_track_font_variant = ConvertJavaStringToUTF8(
1257 env, textTrackFontVariant);
1258 params.text_track_text_color = ConvertJavaStringToUTF8(
1259 env, textTrackTextColor);
1260 params.text_track_text_shadow = ConvertJavaStringToUTF8(
1261 env, textTrackTextShadow);
1262 params.text_track_text_size = ConvertJavaStringToUTF8(
1263 env, textTrackTextSize);
1264
1265 web_contents_->GetMainFrame()->SetTextTrackSettings(params);
1266 }
1267
1240 bool ContentViewCoreImpl::IsFullscreenRequiredForOrientationLock() const { 1268 bool ContentViewCoreImpl::IsFullscreenRequiredForOrientationLock() const {
1241 JNIEnv* env = AttachCurrentThread(); 1269 JNIEnv* env = AttachCurrentThread();
1242 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 1270 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1243 if (obj.is_null()) 1271 if (obj.is_null())
1244 return true; 1272 return true;
1245 return Java_ContentViewCore_isFullscreenRequiredForOrientationLock(env, 1273 return Java_ContentViewCore_isFullscreenRequiredForOrientationLock(env,
1246 obj.obj()); 1274 obj.obj());
1247 } 1275 }
1248 1276
1249 void ContentViewCoreImpl::SetAccessibilityEnabledInternal(bool enabled) { 1277 void ContentViewCoreImpl::SetAccessibilityEnabledInternal(bool enabled) {
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
1391 return NULL; 1419 return NULL;
1392 1420
1393 return view->GetJavaObject().Release(); 1421 return view->GetJavaObject().Release();
1394 } 1422 }
1395 1423
1396 bool RegisterContentViewCore(JNIEnv* env) { 1424 bool RegisterContentViewCore(JNIEnv* env) {
1397 return RegisterNativesImpl(env); 1425 return RegisterNativesImpl(env);
1398 } 1426 }
1399 1427
1400 } // namespace content 1428 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698