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

Unified Diff: android_webview/native/aw_contents.h

Issue 11823027: [Android WebView] Implement the capture picture API. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: adding findbugs update from 11825002 to make the trybots happy. Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: android_webview/native/aw_contents.h
diff --git a/android_webview/native/aw_contents.h b/android_webview/native/aw_contents.h
index d482465afa9078b63f2ef04a436a01128b3064e8..fbcbb3f29a33a9fb775b85f657277122a082439a 100644
--- a/android_webview/native/aw_contents.h
+++ b/android_webview/native/aw_contents.h
@@ -16,6 +16,8 @@
#include "base/memory/scoped_ptr.h"
#include "content/public/browser/android/compositor.h"
#include "content/public/browser/javascript_dialogs.h"
+#include "skia/ext/refptr.h"
+#include "third_party/skia/include/core/SkPicture.h"
typedef void* EGLContext;
class TabContents;
@@ -102,6 +104,11 @@ class AwContents : public FindHelper::Listener,
void SetScrollForHWFrame(JNIEnv* env, jobject obj,
int scroll_x, int scroll_y);
void FocusFirstNode(JNIEnv* env, jobject obj);
+ void CapturePicture(JNIEnv* env, jobject obj, jobject picture_data);
+ void EnableOnNewPicture(JNIEnv* env,
+ jobject obj,
+ jboolean enabled,
+ jboolean invalidation_only);
// Find-in-page API and related methods.
jint FindAllSync(JNIEnv* env, jobject obj, jstring search_string);
@@ -127,6 +134,10 @@ class AwContents : public FindHelper::Listener,
// AwRenderViewHostExt::Client implementation.
virtual void OnPictureUpdated(int process_id, int render_view_id) OVERRIDE;
+ // Returns the latest locally available picture if any.
+ // If none is available will synchronously request the latest one.
+ skia::RefPtr<SkPicture> GetLastCapturedPicture();
+
private:
void Invalidate();
void SetWebContents(content::WebContents* web_contents);
@@ -151,6 +162,8 @@ class AwContents : public FindHelper::Listener,
bool view_visible_;
bool compositor_visible_;
bool is_composite_pending_;
+ bool on_new_picture_enabled_;
+ bool on_new_picture_invalidation_only_;
// Used only for detecting Android View System context changes.
// Not to be used between draw calls.

Powered by Google App Engine
This is Rietveld 408576698