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

Unified Diff: ios/web/public/web_state/web_state.h

Issue 2945213002: [ios] Snapshot for WebState (Closed)
Patch Set: Address comments. Created 3 years, 6 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: ios/web/public/web_state/web_state.h
diff --git a/ios/web/public/web_state/web_state.h b/ios/web/public/web_state/web_state.h
index 6974f523942f2691752762d1a997bb86f4d2338b..986095eabbe84c9286670a086b473d6ce226a47a 100644
--- a/ios/web/public/web_state/web_state.h
+++ b/ios/web/public/web_state/web_state.h
@@ -35,6 +35,10 @@ class DictionaryValue;
class Value;
}
+namespace gfx {
+class Image;
+}
+
namespace web {
class BrowserState;
@@ -248,6 +252,14 @@ class WebState : public base::SupportsUserData {
// CreateParams::created_with_opener for more details.
virtual bool HasOpener() const = 0;
+ // Callback used to handle snapshots. The parameter is the snapshot image.
+ typedef base::Callback<void(const gfx::Image&)> SnapshotCallback;
+
+ // Takes a snapshot of this WebState with |target_size|. |callback| is
+ // asynchronously invoked after performing the snapshot.
+ virtual void TakeSnapshot(const SnapshotCallback& callback,
+ const CGSize target_size) const = 0;
+
protected:
friend class WebStateObserver;
friend class WebStatePolicyDecider;

Powered by Google App Engine
This is Rietveld 408576698