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

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

Issue 444843002: Cache the current WebPreferences on RenderViewHostImpl (try #2). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix. Created 6 years, 4 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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
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->UpdateWebkitPreferences( 161 render_view_host->OnWebkitPreferencesChanged();
162 render_view_host->GetWebkitPreferences());
163 } 162 }
164 163
165 void AwSettings::UpdateInitialPageScaleLocked(JNIEnv* env, jobject obj) { 164 void AwSettings::UpdateInitialPageScaleLocked(JNIEnv* env, jobject obj) {
166 AwRenderViewHostExt* rvhe = GetAwRenderViewHostExt(); 165 AwRenderViewHostExt* rvhe = GetAwRenderViewHostExt();
167 if (!rvhe) return; 166 if (!rvhe) return;
168 167
169 float initial_page_scale_percent = 168 float initial_page_scale_percent =
170 Java_AwSettings_getInitialPageScalePercentLocked(env, obj); 169 Java_AwSettings_getInitialPageScalePercentLocked(env, obj);
171 if (initial_page_scale_percent == 0) { 170 if (initial_page_scale_percent == 0) {
172 rvhe->SetInitialPageScale(-1); 171 rvhe->SetInitialPageScale(-1);
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 405
407 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { 406 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) {
408 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release(); 407 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release();
409 } 408 }
410 409
411 bool RegisterAwSettings(JNIEnv* env) { 410 bool RegisterAwSettings(JNIEnv* env) {
412 return RegisterNativesImpl(env); 411 return RegisterNativesImpl(env);
413 } 412 }
414 413
415 } // namespace android_webview 414 } // 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