| OLD | NEW |
| 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 Loading... |
| 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); |
| 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 Loading... |
| 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 member (i.e. is not persisted with session |
| 212 // restore). The screenshot of a page is taken when navigating away from the |
| 213 // page. This screenshot is displayed during an overscroll-navigation |
| 214 // gesture. |screenshot_| will be NULL when the screenshot is not available |
| 215 // (e.g. after a session restore, or if taking the screenshot of a page |
| 216 // failed). The UI is responsible for dealing with missing screenshots |
| 217 // appropriately (e.g. display a placeholder image instead). |
| 218 scoped_refptr<base::RefCountedBytes> screenshot_; |
| 219 |
| 206 // This member is not persisted with session restore. | 220 // This member is not persisted with session restore. |
| 207 std::string extra_headers_; | 221 std::string extra_headers_; |
| 208 | 222 |
| 209 // Used for specifying base URL for pages loaded via data URLs. Only used and | 223 // Used for specifying base URL for pages loaded via data URLs. Only used and |
| 210 // persisted by Android WebView. | 224 // persisted by Android WebView. |
| 211 GURL base_url_for_data_url_; | 225 GURL base_url_for_data_url_; |
| 212 | 226 |
| 213 // Whether the entry, while loading, was created for a renderer-initiated | 227 // Whether the entry, while loading, was created for a renderer-initiated |
| 214 // navigation. This dictates whether the URL should be displayed before the | 228 // navigation. This dictates whether the URL should be displayed before the |
| 215 // navigation commits. It is cleared on commit and not persisted. | 229 // navigation commits. It is cleared on commit and not persisted. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 244 // Set when this entry should be able to access local file:// resources. This | 258 // 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. | 259 // value is not needed after the entry commits and is not persisted. |
| 246 bool can_load_local_resources_; | 260 bool can_load_local_resources_; |
| 247 | 261 |
| 248 // Copy and assignment is explicitly allowed for this class. | 262 // Copy and assignment is explicitly allowed for this class. |
| 249 }; | 263 }; |
| 250 | 264 |
| 251 } // namespace content | 265 } // namespace content |
| 252 | 266 |
| 253 #endif // CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_ENTRY_IMPL_H_ | 267 #endif // CONTENT_BROWSER_WEB_CONTENTS_NAVIGATION_ENTRY_IMPL_H_ |
| OLD | NEW |