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

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

Issue 944053004: OffscreenPreRaster and its plumbings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 5 years, 10 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
« no previous file with comments | « android_webview/native/aw_settings.h ('k') | no next file » | 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 if (video_overlay != prefs->use_video_overlay_for_embedded_encrypted_video) { 202 if (video_overlay != prefs->use_video_overlay_for_embedded_encrypted_video) {
203 prefs->use_video_overlay_for_embedded_encrypted_video = video_overlay; 203 prefs->use_video_overlay_for_embedded_encrypted_video = video_overlay;
204 update_prefs = true; 204 update_prefs = true;
205 } 205 }
206 206
207 content::RenderViewHost* host = web_contents()->GetRenderViewHost(); 207 content::RenderViewHost* host = web_contents()->GetRenderViewHost();
208 if (update_prefs && host) 208 if (update_prefs && host)
209 host->SyncRendererPrefs(); 209 host->SyncRendererPrefs();
210 } 210 }
211 211
212 void AwSettings::UpdateOffscreenPreRasterLocked(JNIEnv* env,
213 jobject obj,
214 jboolean enabled) {
215 AwContents* contents = AwContents::FromWebContents(web_contents());
216 if (contents) {
217 contents->SetOffscreenPreRaster(enabled);
boliu 2015/02/21 00:03:00 This breaks the existing pattern that native reads
hush (inactive) 2015/02/21 00:27:03 Done.
218 }
219 }
220
212 void AwSettings::RenderViewCreated(content::RenderViewHost* render_view_host) { 221 void AwSettings::RenderViewCreated(content::RenderViewHost* render_view_host) {
213 // A single WebContents can normally have 0 to many RenderViewHost instances 222 // A single WebContents can normally have 0 to many RenderViewHost instances
214 // associated with it. 223 // associated with it.
215 // This is important since there is only one RenderViewHostExt instance per 224 // This is important since there is only one RenderViewHostExt instance per
216 // WebContents (and not one RVHExt per RVH, as you might expect) and updating 225 // WebContents (and not one RVHExt per RVH, as you might expect) and updating
217 // settings via RVHExt only ever updates the 'current' RVH. 226 // settings via RVHExt only ever updates the 'current' RVH.
218 // In android_webview we don't swap out the RVH on cross-site navigations, so 227 // In android_webview we don't swap out the RVH on cross-site navigations, so
219 // we shouldn't have to deal with the multiple RVH per WebContents case. That 228 // we shouldn't have to deal with the multiple RVH per WebContents case. That
220 // in turn means that the newly created RVH is always the 'current' RVH 229 // in turn means that the newly created RVH is always the 'current' RVH
221 // (since we only ever go from 0 to 1 RVH instances) and hence the DCHECK. 230 // (since we only ever go from 0 to 1 RVH instances) and hence the DCHECK.
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 426
418 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) { 427 static jstring GetDefaultUserAgent(JNIEnv* env, jclass clazz) {
419 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release(); 428 return base::android::ConvertUTF8ToJavaString(env, GetUserAgent()).Release();
420 } 429 }
421 430
422 bool RegisterAwSettings(JNIEnv* env) { 431 bool RegisterAwSettings(JNIEnv* env) {
423 return RegisterNativesImpl(env); 432 return RegisterNativesImpl(env);
424 } 433 }
425 434
426 } // namespace android_webview 435 } // namespace android_webview
OLDNEW
« no previous file with comments | « android_webview/native/aw_settings.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698