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

Side by Side 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 7 years, 12 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 #ifndef CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_ENTRY_IMPL_H_ 5 #ifndef CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_ENTRY_IMPL_H_
6 #define CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_ENTRY_IMPL_H_ 6 #define CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_ENTRY_IMPL_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "content/browser/site_instance_impl.h" 10 #include "content/browser/site_instance_impl.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // Whether this (pending) navigation needs to replace current entry. 160 // Whether this (pending) navigation needs to replace current entry.
161 // Resets to false after commit. 161 // Resets to false after commit.
162 bool should_replace_entry() const { 162 bool should_replace_entry() const {
163 return should_replace_entry_; 163 return should_replace_entry_;
164 } 164 }
165 165
166 void set_should_replace_entry(bool should_replace_entry) { 166 void set_should_replace_entry(bool should_replace_entry) {
167 should_replace_entry_ = should_replace_entry; 167 should_replace_entry_ = should_replace_entry;
168 } 168 }
169 169
170 void SetScreenshotPNGData(const std::vector<unsigned char>& png_data);
Charlie Reis 2012/12/21 23:22:07 We might be prematurely optimizing with PNG (espec
sadrul 2012/12/22 00:07:10 I didn't have optimization in mind when I used the
171 const scoped_refptr<base::RefCountedBytes> screenshot() const {
172 return screenshot_;
173 }
174
170 private: 175 private:
171 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 176 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
172 // Session/Tab restore save portions of this class so that it can be recreated 177 // Session/Tab restore save portions of this class so that it can be recreated
173 // later. If you add a new field that needs to be persisted you'll have to 178 // later. If you add a new field that needs to be persisted you'll have to
174 // update SessionService/TabRestoreService and Android WebView 179 // update SessionService/TabRestoreService and Android WebView
175 // state_serializer.cc appropriately. 180 // state_serializer.cc appropriately.
176 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 181 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
177 182
178 // See the accessors above for descriptions. 183 // See the accessors above for descriptions.
179 int unique_id_; 184 int unique_id_;
(...skipping 16 matching lines...) Expand all
196 GURL original_request_url_; 201 GURL original_request_url_;
197 bool is_overriding_user_agent_; 202 bool is_overriding_user_agent_;
198 base::Time timestamp_; 203 base::Time timestamp_;
199 204
200 // This member is not persisted with session restore because it is transient. 205 // This member is not persisted with session restore because it is transient.
201 // If the post request succeeds, this field is cleared since the same 206 // If the post request succeeds, this field is cleared since the same
202 // information is stored in |content_state_| above. It is also only shallow 207 // information is stored in |content_state_| above. It is also only shallow
203 // copied with compiler provided copy constructor. 208 // copied with compiler provided copy constructor.
204 scoped_refptr<const base::RefCountedMemory> browser_initiated_post_data_; 209 scoped_refptr<const base::RefCountedMemory> browser_initiated_post_data_;
205 210
211 // This is also a transient memeber (i.e. is not persisted with session
Charlie Reis 2012/12/21 23:22:07 typo: memeber Also, please explain when this scre
sadrul 2012/12/22 00:07:10 Done.
212 // restore).
213 scoped_refptr<base::RefCountedBytes> screenshot_;
214
206 // This member is not persisted with session restore. 215 // This member is not persisted with session restore.
207 std::string extra_headers_; 216 std::string extra_headers_;
208 217
209 // Used for specifying base URL for pages loaded via data URLs. Only used and 218 // Used for specifying base URL for pages loaded via data URLs. Only used and
210 // persisted by Android WebView. 219 // persisted by Android WebView.
211 GURL base_url_for_data_url_; 220 GURL base_url_for_data_url_;
212 221
213 // Whether the entry, while loading, was created for a renderer-initiated 222 // Whether the entry, while loading, was created for a renderer-initiated
214 // navigation. This dictates whether the URL should be displayed before the 223 // navigation. This dictates whether the URL should be displayed before the
215 // navigation commits. It is cleared on commit and not persisted. 224 // navigation commits. It is cleared on commit and not persisted.
(...skipping 28 matching lines...) Expand all
244 // Set when this entry should be able to access local file:// resources. This 253 // Set when this entry should be able to access local file:// resources. This
245 // value is not needed after the entry commits and is not persisted. 254 // value is not needed after the entry commits and is not persisted.
246 bool can_load_local_resources_; 255 bool can_load_local_resources_;
247 256
248 // Copy and assignment is explicitly allowed for this class. 257 // Copy and assignment is explicitly allowed for this class.
249 }; 258 };
250 259
251 } // namespace content 260 } // namespace content
252 261
253 #endif // CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_ENTRY_IMPL_H_ 262 #endif // CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_ENTRY_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698