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

Unified Diff: android_webview/native/aw_contents.cc

Issue 784343002: [draft] flush visual state prototype (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: android_webview/native/aw_contents.cc
diff --git a/android_webview/native/aw_contents.cc b/android_webview/native/aw_contents.cc
index 8494ed176785b50b0247871ab0c4886bfe3a4655..5a2295dec568e218770b165123a8b2563357f6ea 100644
--- a/android_webview/native/aw_contents.cc
+++ b/android_webview/native/aw_contents.cc
@@ -1046,6 +1046,25 @@ void AwContents::EnableOnNewPicture(JNIEnv* env,
browser_view_renderer_.EnableOnNewPicture(enabled);
}
+namespace {
+void FlushVisualStateCallback(ScopedJavaGlobalRef<jobject>* callback,
+ bool result) {
+ JNIEnv* env = AttachCurrentThread();
+ Java_AwContents_flushVisualStateCallback(
+ env,
+ callback->obj(),
+ !result);
+}
+} // namespace
+
+void AwContents::FlushVisualState(JNIEnv* env, jobject obj, jobject callback) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ ScopedJavaGlobalRef<jobject>* j_callback = new ScopedJavaGlobalRef<jobject>();
+ j_callback->Reset(env, callback);
+ web_contents_->GetMainFrame()->FlushVisualState(
+ base::Bind(&FlushVisualStateCallback, base::Owned(j_callback)));
+}
+
void AwContents::ClearView(JNIEnv* env, jobject obj) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
browser_view_renderer_.ClearView();
« no previous file with comments | « android_webview/native/aw_contents.h ('k') | content/browser/frame_host/render_frame_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698