| 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 } | 190 } |
| 191 | 191 |
| 192 void AwSettings::UpdateWebkitPreferencesLocked(JNIEnv* env, jobject obj) { | 192 void AwSettings::UpdateWebkitPreferencesLocked(JNIEnv* env, jobject obj) { |
| 193 if (!web_contents()) return; | 193 if (!web_contents()) return; |
| 194 AwRenderViewHostExt* render_view_host_ext = GetAwRenderViewHostExt(); | 194 AwRenderViewHostExt* render_view_host_ext = GetAwRenderViewHostExt(); |
| 195 if (!render_view_host_ext) return; | 195 if (!render_view_host_ext) return; |
| 196 | 196 |
| 197 content::RenderViewHost* render_view_host = | 197 content::RenderViewHost* render_view_host = |
| 198 web_contents()->GetRenderViewHost(); | 198 web_contents()->GetRenderViewHost(); |
| 199 if (!render_view_host) return; | 199 if (!render_view_host) return; |
| 200 render_view_host->OnWebkitPreferencesChanged(); | 200 render_view_host->UpdateWebkitPreferences( |
| 201 render_view_host->GetWebkitPreferences()); |
| 201 } | 202 } |
| 202 | 203 |
| 203 void AwSettings::UpdateInitialPageScaleLocked(JNIEnv* env, jobject obj) { | 204 void AwSettings::UpdateInitialPageScaleLocked(JNIEnv* env, jobject obj) { |
| 204 AwRenderViewHostExt* rvhe = GetAwRenderViewHostExt(); | 205 AwRenderViewHostExt* rvhe = GetAwRenderViewHostExt(); |
| 205 if (!rvhe) return; | 206 if (!rvhe) return; |
| 206 | 207 |
| 207 float initial_page_scale_percent = | 208 float initial_page_scale_percent = |
| 208 Java_AwSettings_getInitialPageScalePercentLocked(env, obj); | 209 Java_AwSettings_getInitialPageScalePercentLocked(env, obj); |
| 209 if (initial_page_scale_percent == 0) { | 210 if (initial_page_scale_percent == 0) { |
| 210 rvhe->SetInitialPageScale(-1); | 211 rvhe->SetInitialPageScale(-1); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 | 445 |
| 445 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { | 446 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { |
| 446 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release(); | 447 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release(); |
| 447 } | 448 } |
| 448 | 449 |
| 449 bool RegisterAwSettings(JNIEnv* env) { | 450 bool RegisterAwSettings(JNIEnv* env) { |
| 450 return RegisterNativesImpl(env); | 451 return RegisterNativesImpl(env); |
| 451 } | 452 } |
| 452 | 453 |
| 453 } // namespace android_webview | 454 } // namespace android_webview |
| OLD | NEW |