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 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
319 web_prefs->viewport_meta_zero_values_quirk = support_quirks; | 319 web_prefs->viewport_meta_zero_values_quirk = support_quirks; |
320 web_prefs->clobber_user_agent_initial_scale_quirk = support_quirks; | 320 web_prefs->clobber_user_agent_initial_scale_quirk = support_quirks; |
321 web_prefs->ignore_main_frame_overflow_hidden_quirk = support_quirks; | 321 web_prefs->ignore_main_frame_overflow_hidden_quirk = support_quirks; |
322 web_prefs->report_screen_size_in_physical_pixels_quirk = support_quirks; | 322 web_prefs->report_screen_size_in_physical_pixels_quirk = support_quirks; |
323 | 323 |
324 web_prefs->password_echo_enabled = | 324 web_prefs->password_echo_enabled = |
325 Java_AwSettings_getPasswordEchoEnabledLocked(env, obj); | 325 Java_AwSettings_getPasswordEchoEnabledLocked(env, obj); |
326 web_prefs->spatial_navigation_enabled = | 326 web_prefs->spatial_navigation_enabled = |
327 Java_AwSettings_getSpatialNavigationLocked(env, obj); | 327 Java_AwSettings_getSpatialNavigationLocked(env, obj); |
328 | 328 |
329 web_prefs->accelerated_2d_canvas_enabled = | 329 web_prefs->accelerated_2d_canvas_enabled = true; |
330 !accelerated_2d_canvas_disabled_by_switch_ && | 330 if (accelerated_2d_canvas_disabled_by_switch_ || |
331 Java_AwSettings_getEnableSupportedHardwareAcceleratedFeaturesLocked( | 331 !Java_AwSettings_getEnableSupportedHardwareAcceleratedFeaturesLocked( |
332 env, obj); | 332 env, obj)) { |
333 // Any canvas smaller than this will fallback to software. Abusing this | |
334 // slightly to turn canvas off without changing | |
335 // accelerated_2d_canvas_enabled, which also affects compositing mode. | |
336 web_prefs->minimum_accelerated_2d_canvas_size = | |
337 std::numeric_limits<int>::max(); | |
aelias_OOO_until_Jul13
2014/03/25 23:58:16
INT_MAX is prone to strange bugs because you canno
| |
338 } | |
333 } | 339 } |
334 | 340 |
335 static jlong Init(JNIEnv* env, | 341 static jlong Init(JNIEnv* env, |
336 jobject obj, | 342 jobject obj, |
337 jlong web_contents) { | 343 jlong web_contents) { |
338 AwSettings* settings = new AwSettings(env, obj, web_contents); | 344 AwSettings* settings = new AwSettings(env, obj, web_contents); |
339 return reinterpret_cast<intptr_t>(settings); | 345 return reinterpret_cast<intptr_t>(settings); |
340 } | 346 } |
341 | 347 |
342 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { | 348 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { |
343 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release(); | 349 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release(); |
344 } | 350 } |
345 | 351 |
346 bool RegisterAwSettings(JNIEnv* env) { | 352 bool RegisterAwSettings(JNIEnv* env) { |
347 return RegisterNativesImpl(env) >= 0; | 353 return RegisterNativesImpl(env) >= 0; |
348 } | 354 } |
349 | 355 |
350 } // namespace android_webview | 356 } // namespace android_webview |
OLD | NEW |