Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: android_webview/native/aw_settings.cc

Issue 373323003: Cache the current WebPreferences on RenderViewHostImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix android build. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/android/voice_search_tab_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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->UpdateWebkitPreferences( 200 render_view_host->OnWebkitPreferencesChanged();
201 render_view_host->GetWebkitPreferences());
202 } 201 }
203 202
204 void AwSettings::UpdateInitialPageScaleLocked(JNIEnv* env, jobject obj) { 203 void AwSettings::UpdateInitialPageScaleLocked(JNIEnv* env, jobject obj) {
205 AwRenderViewHostExt* rvhe = GetAwRenderViewHostExt(); 204 AwRenderViewHostExt* rvhe = GetAwRenderViewHostExt();
206 if (!rvhe) return; 205 if (!rvhe) return;
207 206
208 float initial_page_scale_percent = 207 float initial_page_scale_percent =
209 Java_AwSettings_getInitialPageScalePercentLocked(env, obj); 208 Java_AwSettings_getInitialPageScalePercentLocked(env, obj);
210 if (initial_page_scale_percent == 0) { 209 if (initial_page_scale_percent == 0) {
211 rvhe->SetInitialPageScale(-1); 210 rvhe->SetInitialPageScale(-1);
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 444
446 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { 445 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) {
447 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release(); 446 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release();
448 } 447 }
449 448
450 bool RegisterAwSettings(JNIEnv* env) { 449 bool RegisterAwSettings(JNIEnv* env) {
451 return RegisterNativesImpl(env); 450 return RegisterNativesImpl(env);
452 } 451 }
453 452
454 } // namespace android_webview 453 } // namespace android_webview
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/voice_search_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698