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/native/aw_contents.h" | 8 #include "android_webview/native/aw_contents.h" |
9 #include "base/android/jni_android.h" | 9 #include "base/android/jni_android.h" |
10 #include "base/android/jni_string.h" | 10 #include "base/android/jni_string.h" |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 UpdateEverything(); | 170 UpdateEverything(); |
171 } | 171 } |
172 | 172 |
173 void AwSettings::WebContentsDestroyed(content::WebContents* web_contents) { | 173 void AwSettings::WebContentsDestroyed(content::WebContents* web_contents) { |
174 delete this; | 174 delete this; |
175 } | 175 } |
176 | 176 |
177 // static | 177 // static |
178 void AwSettings::PopulateFixedPreferences(WebPreferences* web_prefs) { | 178 void AwSettings::PopulateFixedPreferences(WebPreferences* web_prefs) { |
179 web_prefs->shrinks_standalone_images_to_fit = false; | 179 web_prefs->shrinks_standalone_images_to_fit = false; |
| 180 web_prefs->should_clear_document_background = false; |
180 } | 181 } |
181 | 182 |
182 void AwSettings::PopulateWebPreferences(WebPreferences* web_prefs) { | 183 void AwSettings::PopulateWebPreferences(WebPreferences* web_prefs) { |
183 JNIEnv* env = base::android::AttachCurrentThread(); | 184 JNIEnv* env = base::android::AttachCurrentThread(); |
184 CHECK(env); | 185 CHECK(env); |
185 | 186 |
186 AwRenderViewHostExt* render_view_host_ext = GetAwRenderViewHostExt(); | 187 AwRenderViewHostExt* render_view_host_ext = GetAwRenderViewHostExt(); |
187 if (!render_view_host_ext) return; | 188 if (!render_view_host_ext) return; |
188 | 189 |
189 ScopedJavaLocalRef<jobject> scoped_obj = aw_settings_.get(env); | 190 ScopedJavaLocalRef<jobject> scoped_obj = aw_settings_.get(env); |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { | 324 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { |
324 return base::android::ConvertUTF8ToJavaString( | 325 return base::android::ConvertUTF8ToJavaString( |
325 env, content::GetUserAgent(GURL())).Release(); | 326 env, content::GetUserAgent(GURL())).Release(); |
326 } | 327 } |
327 | 328 |
328 bool RegisterAwSettings(JNIEnv* env) { | 329 bool RegisterAwSettings(JNIEnv* env) { |
329 return RegisterNativesImpl(env) >= 0; | 330 return RegisterNativesImpl(env) >= 0; |
330 } | 331 } |
331 | 332 |
332 } // namespace android_webview | 333 } // namespace android_webview |
OLD | NEW |