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

Unified Diff: content/renderer/render_view_impl.h

Issue 11399002: Implemented GetWindowSnapshot on RenderViewImpl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Addressing nits Created 8 years, 1 month 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: content/renderer/render_view_impl.h
diff --git a/content/renderer/render_view_impl.h b/content/renderer/render_view_impl.h
index 468c268f60e8b0d308f06e551c68259f67180087..5721e4231f08c63f96f559d9dd1e56babf5e76b4 100644
--- a/content/renderer/render_view_impl.h
+++ b/content/renderer/render_view_impl.h
@@ -365,6 +365,13 @@ class RenderViewImpl : public RenderWidget,
// supported PPAPI plug-ins.
bool HasIMETextFocus();
+ // Callback for use with GetWindowSnapshot.
+ typedef base::Callback<void(
+ const gfx::Size&, const std::vector<unsigned char>&)>
+ WindowSnapshotCallback;
+
+ void GetWindowSnapshot(const WindowSnapshotCallback& callback);
+
// IPC::Listener implementation ----------------------------------------------
virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
@@ -1022,6 +1029,9 @@ class RenderViewImpl : public RenderWidget,
const gfx::Rect& view_frame);
#endif
+ void OnWindowSnapshotCompleted(const int snapshot_id,
+ const gfx::Size& size, const std::vector<unsigned char>& png);
+
// Adding a new message handler? Please add it in alphabetical order above
// and put it in the same position in the .cc file.
@@ -1494,6 +1504,12 @@ class RenderViewImpl : public RenderWidget,
// Wraps the |webwidget_| as a MouseLockDispatcher::LockTarget interface.
scoped_ptr<MouseLockDispatcher::LockTarget> webwidget_mouse_lock_target_;
+ // State associated with the GetWindowSnapshot function.
+ int next_snapshot_id_;
+ typedef std::map<int, WindowSnapshotCallback>
+ PendingSnapshotMap;
+ PendingSnapshotMap pending_snapshots_;
+
// Plugins -------------------------------------------------------------------
// All the currently active plugin delegates for this RenderView; kept so

Powered by Google App Engine
This is Rietveld 408576698