OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_contents.h" | 5 #include "android_webview/native/aw_contents.h" |
6 | 6 |
7 #include <limits> | 7 #include <limits> |
8 | 8 |
9 #include "android_webview/browser/aw_browser_context.h" | 9 #include "android_webview/browser/aw_browser_context.h" |
10 #include "android_webview/browser/aw_browser_main_parts.h" | 10 #include "android_webview/browser/aw_browser_main_parts.h" |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 } | 732 } |
733 | 733 |
734 void AwContents::PostInvalidate() { | 734 void AwContents::PostInvalidate() { |
735 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 735 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
736 JNIEnv* env = AttachCurrentThread(); | 736 JNIEnv* env = AttachCurrentThread(); |
737 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 737 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
738 if (!obj.is_null()) | 738 if (!obj.is_null()) |
739 Java_AwContents_postInvalidateOnAnimation(env, obj.obj()); | 739 Java_AwContents_postInvalidateOnAnimation(env, obj.obj()); |
740 } | 740 } |
741 | 741 |
| 742 void AwContents::InvalidateOnceIfNeeded() { |
| 743 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 744 browser_view_renderer_.InvalidateOnceIfNeeded(); |
| 745 } |
| 746 |
742 void AwContents::OnNewPicture() { | 747 void AwContents::OnNewPicture() { |
743 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 748 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
744 JNIEnv* env = AttachCurrentThread(); | 749 JNIEnv* env = AttachCurrentThread(); |
745 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); | 750 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); |
746 if (!obj.is_null()) { | 751 if (!obj.is_null()) { |
747 devtools_instrumentation::ScopedEmbedderCallbackTask embedder_callback( | 752 devtools_instrumentation::ScopedEmbedderCallbackTask embedder_callback( |
748 "onNewPicture"); | 753 "onNewPicture"); |
749 Java_AwContents_onNewPicture(env, obj.obj()); | 754 Java_AwContents_onNewPicture(env, obj.obj()); |
750 } | 755 } |
751 } | 756 } |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1144 } | 1149 } |
1145 | 1150 |
1146 browser_view_renderer_.TrimMemory(level, visible); | 1151 browser_view_renderer_.TrimMemory(level, visible); |
1147 } | 1152 } |
1148 | 1153 |
1149 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { | 1154 void SetShouldDownloadFavicons(JNIEnv* env, jclass jclazz) { |
1150 g_should_download_favicons = true; | 1155 g_should_download_favicons = true; |
1151 } | 1156 } |
1152 | 1157 |
1153 } // namespace android_webview | 1158 } // namespace android_webview |
OLD | NEW |