| 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 } | 151 } |
| 152 | 152 |
| 153 void AwSettings::UpdateWebkitPreferencesLocked(JNIEnv* env, jobject obj) { | 153 void AwSettings::UpdateWebkitPreferencesLocked(JNIEnv* env, jobject obj) { |
| 154 if (!web_contents()) return; | 154 if (!web_contents()) return; |
| 155 AwRenderViewHostExt* render_view_host_ext = GetAwRenderViewHostExt(); | 155 AwRenderViewHostExt* render_view_host_ext = GetAwRenderViewHostExt(); |
| 156 if (!render_view_host_ext) return; | 156 if (!render_view_host_ext) return; |
| 157 | 157 |
| 158 content::RenderViewHost* render_view_host = | 158 content::RenderViewHost* render_view_host = |
| 159 web_contents()->GetRenderViewHost(); | 159 web_contents()->GetRenderViewHost(); |
| 160 if (!render_view_host) return; | 160 if (!render_view_host) return; |
| 161 render_view_host->OnWebkitPreferencesChanged(); | 161 render_view_host->UpdateWebkitPreferences( |
| 162 render_view_host->GetWebkitPreferences()); |
| 162 } | 163 } |
| 163 | 164 |
| 164 void AwSettings::UpdateInitialPageScaleLocked(JNIEnv* env, jobject obj) { | 165 void AwSettings::UpdateInitialPageScaleLocked(JNIEnv* env, jobject obj) { |
| 165 AwRenderViewHostExt* rvhe = GetAwRenderViewHostExt(); | 166 AwRenderViewHostExt* rvhe = GetAwRenderViewHostExt(); |
| 166 if (!rvhe) return; | 167 if (!rvhe) return; |
| 167 | 168 |
| 168 float initial_page_scale_percent = | 169 float initial_page_scale_percent = |
| 169 Java_AwSettings_getInitialPageScalePercentLocked(env, obj); | 170 Java_AwSettings_getInitialPageScalePercentLocked(env, obj); |
| 170 if (initial_page_scale_percent == 0) { | 171 if (initial_page_scale_percent == 0) { |
| 171 rvhe->SetInitialPageScale(-1); | 172 rvhe->SetInitialPageScale(-1); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 | 406 |
| 406 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { | 407 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { |
| 407 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release(); | 408 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release(); |
| 408 } | 409 } |
| 409 | 410 |
| 410 bool RegisterAwSettings(JNIEnv* env) { | 411 bool RegisterAwSettings(JNIEnv* env) { |
| 411 return RegisterNativesImpl(env); | 412 return RegisterNativesImpl(env); |
| 412 } | 413 } |
| 413 | 414 |
| 414 } // namespace android_webview | 415 } // namespace android_webview |
| OLD | NEW |