OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_RENDERER_NAVIGATION_STATE_H_ | 5 #ifndef CHROME_RENDERER_NAVIGATION_STATE_H_ |
6 #define CHROME_RENDERER_NAVIGATION_STATE_H_ | 6 #define CHROME_RENDERER_NAVIGATION_STATE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 // The RenderView stores an instance of this class in the "extra data" of each | 26 // The RenderView stores an instance of this class in the "extra data" of each |
27 // WebDataSource (see RenderView::DidCreateDataSource). | 27 // WebDataSource (see RenderView::DidCreateDataSource). |
28 class NavigationState : public WebKit::WebDataSource::ExtraData { | 28 class NavigationState : public WebKit::WebDataSource::ExtraData { |
29 public: | 29 public: |
30 enum LoadType { | 30 enum LoadType { |
31 UNDEFINED_LOAD, // Not yet initialized. | 31 UNDEFINED_LOAD, // Not yet initialized. |
32 RELOAD, // User pressed reload. | 32 RELOAD, // User pressed reload. |
33 HISTORY_LOAD, // Back or forward. | 33 HISTORY_LOAD, // Back or forward. |
34 NORMAL_LOAD, // User entered URL, or omnibox search. | 34 NORMAL_LOAD, // User entered URL, or omnibox search. |
| 35 PRERENDER_LOAD, // Navigation started as the speculatively |
| 36 // prendering of a linked page. |
35 LINK_LOAD, // (deprecated) Included next 4 categories. | 37 LINK_LOAD, // (deprecated) Included next 4 categories. |
36 LINK_LOAD_NORMAL, // Commonly following of link. | 38 LINK_LOAD_NORMAL, // Commonly following of link. |
37 LINK_LOAD_RELOAD, // JS/link directed reload. | 39 LINK_LOAD_RELOAD, // JS/link directed reload. |
38 LINK_LOAD_CACHE_STALE_OK, // back/forward or encoding change. | 40 LINK_LOAD_CACHE_STALE_OK, // back/forward or encoding change. |
39 LINK_LOAD_CACHE_ONLY, // Allow stale data (avoid doing a re-post) | 41 LINK_LOAD_CACHE_ONLY, // Allow stale data (avoid doing a re-post) |
40 kLoadTypeMax // Bounding value for this enum. | 42 kLoadTypeMax // Bounding value for this enum. |
41 }; | 43 }; |
42 | 44 |
43 virtual ~NavigationState(); | 45 virtual ~NavigationState(); |
44 | 46 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 void set_postpone_loading_data(bool postpone_loading_data) { | 205 void set_postpone_loading_data(bool postpone_loading_data) { |
204 postpone_loading_data_ = postpone_loading_data; | 206 postpone_loading_data_ = postpone_loading_data; |
205 } | 207 } |
206 | 208 |
207 const std::string& postponed_data() const { return postponed_data_; } | 209 const std::string& postponed_data() const { return postponed_data_; } |
208 void clear_postponed_data() { postponed_data_.clear(); } | 210 void clear_postponed_data() { postponed_data_.clear(); } |
209 void append_postponed_data(const char* data, size_t data_len) { | 211 void append_postponed_data(const char* data, size_t data_len) { |
210 postponed_data_.append(data, data_len); | 212 postponed_data_.append(data, data_len); |
211 } | 213 } |
212 | 214 |
| 215 bool is_prerendering() const { return is_prerendering_; } |
| 216 void set_is_prerendering(bool is_prerendering) { |
| 217 is_prerendering_ = is_prerendering; |
| 218 } |
| 219 |
213 int http_status_code() const { return http_status_code_; } | 220 int http_status_code() const { return http_status_code_; } |
214 void set_http_status_code(int http_status_code) { | 221 void set_http_status_code(int http_status_code) { |
215 http_status_code_ = http_status_code; | 222 http_status_code_ = http_status_code; |
216 } | 223 } |
217 | 224 |
218 // Sets the cache policy. The cache policy is only used if explicitly set and | 225 // Sets the cache policy. The cache policy is only used if explicitly set and |
219 // by default is not set. You can mark a NavigationState as not having a cache | 226 // by default is not set. You can mark a NavigationState as not having a cache |
220 // state by way of clear_cache_policy_override. | 227 // state by way of clear_cache_policy_override. |
221 void set_cache_policy_override( | 228 void set_cache_policy_override( |
222 WebKit::WebURLRequest::CachePolicy cache_policy) { | 229 WebKit::WebURLRequest::CachePolicy cache_policy) { |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 int32 pending_page_id_; | 301 int32 pending_page_id_; |
295 int pending_history_list_offset_; | 302 int pending_history_list_offset_; |
296 GURL searchable_form_url_; | 303 GURL searchable_form_url_; |
297 std::string searchable_form_encoding_; | 304 std::string searchable_form_encoding_; |
298 scoped_ptr<webkit_glue::PasswordForm> password_form_data_; | 305 scoped_ptr<webkit_glue::PasswordForm> password_form_data_; |
299 scoped_ptr<webkit_glue::AltErrorPageResourceFetcher> alt_error_page_fetcher_; | 306 scoped_ptr<webkit_glue::AltErrorPageResourceFetcher> alt_error_page_fetcher_; |
300 std::string security_info_; | 307 std::string security_info_; |
301 bool postpone_loading_data_; | 308 bool postpone_loading_data_; |
302 std::string postponed_data_; | 309 std::string postponed_data_; |
303 | 310 |
| 311 // True if page is being prerendered. False once prerendered page is |
| 312 // displayed. |
| 313 bool is_prerendering_; |
| 314 |
304 bool cache_policy_override_set_; | 315 bool cache_policy_override_set_; |
305 WebKit::WebURLRequest::CachePolicy cache_policy_override_; | 316 WebKit::WebURLRequest::CachePolicy cache_policy_override_; |
306 | 317 |
307 scoped_ptr<UserScriptIdleScheduler> user_script_idle_scheduler_; | 318 scoped_ptr<UserScriptIdleScheduler> user_script_idle_scheduler_; |
308 int http_status_code_; | 319 int http_status_code_; |
309 | 320 |
310 bool was_fetched_via_spdy_; | 321 bool was_fetched_via_spdy_; |
311 bool was_npn_negotiated_; | 322 bool was_npn_negotiated_; |
312 bool was_alternate_protocol_available_; | 323 bool was_alternate_protocol_available_; |
313 bool was_fetched_via_proxy_; | 324 bool was_fetched_via_proxy_; |
314 bool was_translated_; | 325 bool was_translated_; |
315 bool was_within_same_page_; | 326 bool was_within_same_page_; |
316 | 327 |
317 // A prefetcher is a page that contains link rel=prefetch elements. | 328 // A prefetcher is a page that contains link rel=prefetch elements. |
318 bool was_prefetcher_; | 329 bool was_prefetcher_; |
319 bool was_referred_by_prefetcher_; | 330 bool was_referred_by_prefetcher_; |
320 | 331 |
321 DISALLOW_COPY_AND_ASSIGN(NavigationState); | 332 DISALLOW_COPY_AND_ASSIGN(NavigationState); |
322 }; | 333 }; |
323 | 334 |
324 #endif // CHROME_RENDERER_NAVIGATION_STATE_H_ | 335 #endif // CHROME_RENDERER_NAVIGATION_STATE_H_ |
OLD | NEW |