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/aw_content_browser_client.h" | 7 #include "android_webview/browser/aw_content_browser_client.h" |
8 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" | 8 #include "android_webview/browser/renderer_host/aw_render_view_host_ext.h" |
9 #include "android_webview/common/aw_content_client.h" | 9 #include "android_webview/common/aw_content_client.h" |
10 #include "android_webview/native/aw_contents.h" | 10 #include "android_webview/native/aw_contents.h" |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
422 // Any canvas smaller than this will fallback to software. Abusing this | 422 // Any canvas smaller than this will fallback to software. Abusing this |
423 // slightly to turn canvas off without changing | 423 // slightly to turn canvas off without changing |
424 // accelerated_2d_canvas_enabled, which also affects compositing mode. | 424 // accelerated_2d_canvas_enabled, which also affects compositing mode. |
425 // Using 100M instead of max int to avoid overflows. | 425 // Using 100M instead of max int to avoid overflows. |
426 web_prefs->minimum_accelerated_2d_canvas_size = 100 * 1000 * 1000; | 426 web_prefs->minimum_accelerated_2d_canvas_size = 100 * 1000 * 1000; |
427 } | 427 } |
428 web_prefs->experimental_webgl_enabled = | 428 web_prefs->experimental_webgl_enabled = |
429 web_prefs->experimental_webgl_enabled && | 429 web_prefs->experimental_webgl_enabled && |
430 enable_supported_hardware_accelerated_features; | 430 enable_supported_hardware_accelerated_features; |
431 | 431 |
432 web_prefs->allow_displaying_insecure_content = | 432 // If mixed content running is allowed than displaying must be allowed too. |
433 Java_AwSettings_getAllowDisplayingInsecureContentLocked(env, obj); | 433 DCHECK(!Java_AwSettings_getAllowRunningInsecureContentLocked(env, obj) || |
434 web_prefs->allow_running_insecure_content = | 434 Java_AwSettings_getAllowDisplayingInsecureContentLocked(env, obj)); |
Torne
2016/08/31 12:49:59
These two DCHECKs are identical? Also, it'd be cle
carlosk
2016/09/02 23:47:42
Indeed. But as you also realized, DCHECK_IMPLIES i
| |
435 Java_AwSettings_getAllowRunningInsecureContentLocked(env, obj); | 435 // If mixed content displaying is not allowed than running must not be allowed |
436 // either. | |
437 DCHECK(Java_AwSettings_getAllowDisplayingInsecureContentLocked(env, obj) || | |
438 !Java_AwSettings_getAllowRunningInsecureContentLocked(env, obj)); | |
439 if (Java_AwSettings_getAllowDisplayingInsecureContentLocked(env, obj)) { | |
Torne
2016/08/31 12:49:59
The actual Java side value stored is an enum: WebS
carlosk
2016/09/02 23:47:42
Agreed. I didn't realize those getters were used o
| |
440 web_prefs->strict_mixed_content_checking = false; | |
441 web_prefs->allow_running_insecure_content = | |
442 Java_AwSettings_getAllowRunningInsecureContentLocked(env, obj); | |
443 } else { | |
444 web_prefs->strict_mixed_content_checking = true; | |
445 web_prefs->allow_running_insecure_content = false; | |
446 } | |
436 | 447 |
437 web_prefs->fullscreen_supported = | 448 web_prefs->fullscreen_supported = |
438 Java_AwSettings_getFullscreenSupportedLocked(env, obj); | 449 Java_AwSettings_getFullscreenSupportedLocked(env, obj); |
439 web_prefs->record_whole_document = | 450 web_prefs->record_whole_document = |
440 Java_AwSettings_getRecordFullDocument(env, obj); | 451 Java_AwSettings_getRecordFullDocument(env, obj); |
441 | 452 |
442 // TODO(jww): This should be removed once sufficient warning has been given of | 453 // TODO(jww): This should be removed once sufficient warning has been given of |
443 // possible API breakage because of disabling insecure use of geolocation. | 454 // possible API breakage because of disabling insecure use of geolocation. |
444 web_prefs->allow_geolocation_on_insecure_origins = | 455 web_prefs->allow_geolocation_on_insecure_origins = |
445 Java_AwSettings_getAllowGeolocationOnInsecureOrigins(env, obj); | 456 Java_AwSettings_getAllowGeolocationOnInsecureOrigins(env, obj); |
(...skipping 12 matching lines...) Expand all Loading... | |
458 JNIEnv* env, | 469 JNIEnv* env, |
459 const JavaParamRef<jclass>& clazz) { | 470 const JavaParamRef<jclass>& clazz) { |
460 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()); | 471 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()); |
461 } | 472 } |
462 | 473 |
463 bool RegisterAwSettings(JNIEnv* env) { | 474 bool RegisterAwSettings(JNIEnv* env) { |
464 return RegisterNativesImpl(env); | 475 return RegisterNativesImpl(env); |
465 } | 476 } |
466 | 477 |
467 } // namespace android_webview | 478 } // namespace android_webview |
OLD | NEW |