| OLD | NEW |
| 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 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1274 is_non_ime_change); | 1274 is_non_ime_change); |
| 1275 } | 1275 } |
| 1276 | 1276 |
| 1277 void ContentViewCoreImpl::SetAccessibilityEnabled(JNIEnv* env, jobject obj, | 1277 void ContentViewCoreImpl::SetAccessibilityEnabled(JNIEnv* env, jobject obj, |
| 1278 bool enabled) { | 1278 bool enabled) { |
| 1279 SetAccessibilityEnabledInternal(enabled); | 1279 SetAccessibilityEnabledInternal(enabled); |
| 1280 } | 1280 } |
| 1281 | 1281 |
| 1282 void ContentViewCoreImpl::SetTextTrackSettings(JNIEnv* env, | 1282 void ContentViewCoreImpl::SetTextTrackSettings(JNIEnv* env, |
| 1283 jobject obj, | 1283 jobject obj, |
| 1284 jboolean textTracksEnabled, |
| 1284 jstring textTrackBackgroundColor, | 1285 jstring textTrackBackgroundColor, |
| 1285 jstring textTrackFontFamily, | 1286 jstring textTrackFontFamily, |
| 1286 jstring textTrackFontStyle, | 1287 jstring textTrackFontStyle, |
| 1287 jstring textTrackFontVariant, | 1288 jstring textTrackFontVariant, |
| 1288 jstring textTrackTextColor, | 1289 jstring textTrackTextColor, |
| 1289 jstring textTrackTextShadow, | 1290 jstring textTrackTextShadow, |
| 1290 jstring textTrackTextSize) { | 1291 jstring textTrackTextSize) { |
| 1291 FrameMsg_TextTrackSettings_Params params; | 1292 FrameMsg_TextTrackSettings_Params params; |
| 1293 params.text_tracks_enabled = textTracksEnabled; |
| 1292 params.text_track_background_color = ConvertJavaStringToUTF8( | 1294 params.text_track_background_color = ConvertJavaStringToUTF8( |
| 1293 env, textTrackBackgroundColor); | 1295 env, textTrackBackgroundColor); |
| 1294 params.text_track_font_family = ConvertJavaStringToUTF8( | 1296 params.text_track_font_family = ConvertJavaStringToUTF8( |
| 1295 env, textTrackFontFamily); | 1297 env, textTrackFontFamily); |
| 1296 params.text_track_font_style = ConvertJavaStringToUTF8( | 1298 params.text_track_font_style = ConvertJavaStringToUTF8( |
| 1297 env, textTrackFontStyle); | 1299 env, textTrackFontStyle); |
| 1298 params.text_track_font_variant = ConvertJavaStringToUTF8( | 1300 params.text_track_font_variant = ConvertJavaStringToUTF8( |
| 1299 env, textTrackFontVariant); | 1301 env, textTrackFontVariant); |
| 1300 params.text_track_text_color = ConvertJavaStringToUTF8( | 1302 params.text_track_text_color = ConvertJavaStringToUTF8( |
| 1301 env, textTrackTextColor); | 1303 env, textTrackTextColor); |
| 1302 params.text_track_text_shadow = ConvertJavaStringToUTF8( | 1304 params.text_track_text_shadow = ConvertJavaStringToUTF8( |
| 1303 env, textTrackTextShadow); | 1305 env, textTrackTextShadow); |
| 1304 params.text_track_text_size = ConvertJavaStringToUTF8( | 1306 params.text_track_text_size = ConvertJavaStringToUTF8( |
| 1305 env, textTrackTextSize); | 1307 env, textTrackTextSize); |
| 1306 | |
| 1307 web_contents_->GetMainFrame()->SetTextTrackSettings(params); | 1308 web_contents_->GetMainFrame()->SetTextTrackSettings(params); |
| 1308 } | 1309 } |
| 1309 | 1310 |
| 1310 bool ContentViewCoreImpl::IsFullscreenRequiredForOrientationLock() const { | 1311 bool ContentViewCoreImpl::IsFullscreenRequiredForOrientationLock() const { |
| 1311 JNIEnv* env = AttachCurrentThread(); | 1312 JNIEnv* env = AttachCurrentThread(); |
| 1312 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 1313 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
| 1313 if (obj.is_null()) | 1314 if (obj.is_null()) |
| 1314 return true; | 1315 return true; |
| 1315 return Java_ContentViewCore_isFullscreenRequiredForOrientationLock(env, | 1316 return Java_ContentViewCore_isFullscreenRequiredForOrientationLock(env, |
| 1316 obj.obj()); | 1317 obj.obj()); |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1495 return NULL; | 1496 return NULL; |
| 1496 | 1497 |
| 1497 return view->GetJavaObject().Release(); | 1498 return view->GetJavaObject().Release(); |
| 1498 } | 1499 } |
| 1499 | 1500 |
| 1500 bool RegisterContentViewCore(JNIEnv* env) { | 1501 bool RegisterContentViewCore(JNIEnv* env) { |
| 1501 return RegisterNativesImpl(env); | 1502 return RegisterNativesImpl(env); |
| 1502 } | 1503 } |
| 1503 | 1504 |
| 1504 } // namespace content | 1505 } // namespace content |
| OLD | NEW |