| 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 "android_webview/native/aw_settings.h" | 5 #include "android_webview/native/aw_settings.h" |
| 6 | 6 |
| 7 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" | 7 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" |
| 8 #include "android_webview/common/aw_content_client.h" | 8 #include "android_webview/common/aw_content_client.h" |
| 9 #include "android_webview/native/aw_contents.h" | 9 #include "android_webview/native/aw_contents.h" |
| 10 #include "base/android/jni_android.h" | 10 #include "base/android/jni_android.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 RendererPreferences* prefs = web_contents()->GetMutableRendererPrefs(); | 193 RendererPreferences* prefs = web_contents()->GetMutableRendererPrefs(); |
| 194 | 194 |
| 195 if (!renderer_prefs_initialized_) { | 195 if (!renderer_prefs_initialized_) { |
| 196 PopulateFixedRendererPreferences(prefs); | 196 PopulateFixedRendererPreferences(prefs); |
| 197 renderer_prefs_initialized_ = true; | 197 renderer_prefs_initialized_ = true; |
| 198 update_prefs = true; | 198 update_prefs = true; |
| 199 } | 199 } |
| 200 | 200 |
| 201 bool video_overlay = | 201 bool video_overlay = |
| 202 Java_AwSettings_getVideoOverlayForEmbeddedVideoEnabledLocked(env, obj); | 202 Java_AwSettings_getVideoOverlayForEmbeddedVideoEnabledLocked(env, obj); |
| 203 if (video_overlay != prefs->use_video_overlay_for_embedded_encrypted_video) { | 203 bool force_video_overlay = |
| 204 Java_AwSettings_getForceVideoOverlayForTests(env, obj); |
| 205 if (video_overlay != |
| 206 prefs->use_video_overlay_for_embedded_encrypted_video || |
| 207 force_video_overlay != prefs->use_view_overlay_for_all_video) { |
| 204 prefs->use_video_overlay_for_embedded_encrypted_video = video_overlay; | 208 prefs->use_video_overlay_for_embedded_encrypted_video = video_overlay; |
| 209 prefs->use_view_overlay_for_all_video = force_video_overlay; |
| 205 update_prefs = true; | 210 update_prefs = true; |
| 206 } | 211 } |
| 207 | 212 |
| 208 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); | 213 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); |
| 209 if (update_prefs && host) | 214 if (update_prefs && host) |
| 210 host->SyncRendererPrefs(); | 215 host->SyncRendererPrefs(); |
| 211 } | 216 } |
| 212 | 217 |
| 213 void AwSettings::UpdateOffscreenPreRasterLocked(JNIEnv* env, jobject obj) { | 218 void AwSettings::UpdateOffscreenPreRasterLocked(JNIEnv* env, jobject obj) { |
| 214 AwContents* contents = AwContents::FromWebContents(web_contents()); | 219 AwContents* contents = AwContents::FromWebContents(web_contents()); |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 426 | 431 |
| 427 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { | 432 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { |
| 428 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release(); | 433 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release(); |
| 429 } | 434 } |
| 430 | 435 |
| 431 bool RegisterAwSettings(JNIEnv* env) { | 436 bool RegisterAwSettings(JNIEnv* env) { |
| 432 return RegisterNativesImpl(env); | 437 return RegisterNativesImpl(env); |
| 433 } | 438 } |
| 434 | 439 |
| 435 } // namespace android_webview | 440 } // namespace android_webview |
| OLD | NEW |