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