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

Unified Diff: content/browser/web_contents/navigation_entry_impl.h

Issue 11635059: navigation: Retain a screenshot of the page before it unloads (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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
Index: content/browser/web_contents/navigation_entry_impl.h
diff --git a/content/browser/web_contents/navigation_entry_impl.h b/content/browser/web_contents/navigation_entry_impl.h
index ba13c147fd44b14eed9b8cae8fc866075ec15c24..f69cec9a2a879f6ec1c79fb84e314ca62369776e 100644
--- a/content/browser/web_contents/navigation_entry_impl.h
+++ b/content/browser/web_contents/navigation_entry_impl.h
@@ -167,6 +167,11 @@ class CONTENT_EXPORT NavigationEntryImpl
should_replace_entry_ = should_replace_entry;
}
+ void SetScreenshotPNGData(const std::vector<unsigned char>& png_data);
+ const scoped_refptr<base::RefCountedBytes> screenshot() const {
+ return screenshot_;
+ }
+
private:
// WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
// Session/Tab restore save portions of this class so that it can be recreated
@@ -203,6 +208,15 @@ class CONTENT_EXPORT NavigationEntryImpl
// copied with compiler provided copy constructor.
scoped_refptr<const base::RefCountedMemory> browser_initiated_post_data_;
+ // This is also a transient member (i.e. is not persisted with session
+ // restore). The screenshot of a page is taken when navigating away from the
+ // page. This screenshot is displayed during an overscroll-navigation
+ // gesture. |screenshot_| will be NULL when the screenshot is not available
+ // (e.g. after a session restore, or if taking the screenshot of a page
+ // failed). The UI is responsible for dealing with missing screenshots
+ // appropriately (e.g. display a placeholder image instead).
+ scoped_refptr<base::RefCountedBytes> screenshot_;
+
// This member is not persisted with session restore.
std::string extra_headers_;
« no previous file with comments | « content/browser/web_contents/navigation_controller_impl.cc ('k') | content/browser/web_contents/navigation_entry_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698