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

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

Issue 433733002: Revert 284592 "Cache the current WebPreferences on RenderViewHos..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/2107/src/
Patch Set: 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->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
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
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