| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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_RENDERER_INTERNAL_DOCUMENT_STATE_DATA_H_ | 5 #ifndef CONTENT_RENDERER_INTERNAL_DOCUMENT_STATE_DATA_H_ |
| 6 #define CONTENT_RENDERER_INTERNAL_DOCUMENT_STATE_DATA_H_ | 6 #define CONTENT_RENDERER_INTERNAL_DOCUMENT_STATE_DATA_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/supports_user_data.h" | 11 #include "base/supports_user_data.h" |
| 12 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h" | |
| 13 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 12 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 14 #include "url/gurl.h" | 13 #include "url/gurl.h" |
| 15 | 14 |
| 16 namespace blink { | 15 namespace blink { |
| 17 class WebDataSource; | 16 class WebDataSource; |
| 18 } | 17 } |
| 19 | 18 |
| 20 namespace content { | 19 namespace content { |
| 21 | 20 |
| 22 class DocumentState; | 21 class DocumentState; |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 return cache_policy_override_; | 95 return cache_policy_override_; |
| 97 } | 96 } |
| 98 void clear_cache_policy_override() { | 97 void clear_cache_policy_override() { |
| 99 cache_policy_override_set_ = false; | 98 cache_policy_override_set_ = false; |
| 100 cache_policy_override_ = blink::WebURLRequest::UseProtocolCachePolicy; | 99 cache_policy_override_ = blink::WebURLRequest::UseProtocolCachePolicy; |
| 101 } | 100 } |
| 102 bool is_cache_policy_override_set() const { | 101 bool is_cache_policy_override_set() const { |
| 103 return cache_policy_override_set_; | 102 return cache_policy_override_set_; |
| 104 } | 103 } |
| 105 | 104 |
| 106 // Sets the referrer policy to use. This is only used for browser initiated | |
| 107 // navigations, otherwise, the referrer policy is defined by the frame's | |
| 108 // document. | |
| 109 blink::WebReferrerPolicy referrer_policy() const { | |
| 110 return referrer_policy_; | |
| 111 } | |
| 112 void set_referrer_policy(blink::WebReferrerPolicy referrer_policy) { | |
| 113 referrer_policy_ = referrer_policy; | |
| 114 referrer_policy_set_ = true; | |
| 115 } | |
| 116 void clear_referrer_policy() { | |
| 117 referrer_policy_ = blink::WebReferrerPolicyDefault; | |
| 118 referrer_policy_set_ = false; | |
| 119 } | |
| 120 bool is_referrer_policy_set() const { return referrer_policy_set_; } | |
| 121 | |
| 122 protected: | 105 protected: |
| 123 virtual ~InternalDocumentStateData(); | 106 virtual ~InternalDocumentStateData(); |
| 124 | 107 |
| 125 private: | 108 private: |
| 126 bool did_first_visually_non_empty_layout_; | 109 bool did_first_visually_non_empty_layout_; |
| 127 bool did_first_visually_non_empty_paint_; | 110 bool did_first_visually_non_empty_paint_; |
| 128 int http_status_code_; | 111 int http_status_code_; |
| 129 GURL searchable_form_url_; | 112 GURL searchable_form_url_; |
| 130 std::string searchable_form_encoding_; | 113 std::string searchable_form_encoding_; |
| 131 bool use_error_page_; | 114 bool use_error_page_; |
| 132 bool is_overriding_user_agent_; | 115 bool is_overriding_user_agent_; |
| 133 bool must_reset_scroll_and_scale_state_; | 116 bool must_reset_scroll_and_scale_state_; |
| 134 bool cache_policy_override_set_; | 117 bool cache_policy_override_set_; |
| 135 blink::WebURLRequest::CachePolicy cache_policy_override_; | 118 blink::WebURLRequest::CachePolicy cache_policy_override_; |
| 136 bool referrer_policy_set_; | |
| 137 blink::WebReferrerPolicy referrer_policy_; | |
| 138 | 119 |
| 139 DISALLOW_COPY_AND_ASSIGN(InternalDocumentStateData); | 120 DISALLOW_COPY_AND_ASSIGN(InternalDocumentStateData); |
| 140 }; | 121 }; |
| 141 | 122 |
| 142 } // namespace content | 123 } // namespace content |
| 143 | 124 |
| 144 #endif // CONTENT_RENDERER_INTERNAL_DOCUMENT_STATE_DATA_H_ | 125 #endif // CONTENT_RENDERER_INTERNAL_DOCUMENT_STATE_DATA_H_ |
| OLD | NEW |