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_PUBLIC_RENDERER_DOCUMENT_STATE_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_ |
6 #define CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_ | 6 #define CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
12 #include "base/time.h" | 12 #include "base/time.h" |
13 #include "third_party/WebKit/Source/Platform/chromium/public/WebReferrerPolicy.h
" | 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebReferrerPolicy.h
" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebURLReques
t.h" |
16 | 16 |
17 namespace webkit { | |
18 namespace forms { | |
19 struct PasswordForm; | |
20 } | |
21 } | |
22 | |
23 namespace webkit_glue { | 17 namespace webkit_glue { |
24 class AltErrorPageResourceFetcher; | 18 class AltErrorPageResourceFetcher; |
25 } | 19 } |
26 | 20 |
27 namespace content { | 21 namespace content { |
28 | 22 |
29 class NavigationState; | 23 class NavigationState; |
| 24 struct PasswordForm; |
30 | 25 |
31 // 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 |
32 // WebDataSource (see RenderView::DidCreateDataSource). | 27 // WebDataSource (see RenderView::DidCreateDataSource). |
33 class DocumentState : public WebKit::WebDataSource::ExtraData { | 28 class DocumentState : public WebKit::WebDataSource::ExtraData { |
34 public: | 29 public: |
35 // The exact values of this enum are used in histograms, so new values must be | 30 // The exact values of this enum are used in histograms, so new values must be |
36 // added to the end. | 31 // added to the end. |
37 enum LoadType { | 32 enum LoadType { |
38 UNDEFINED_LOAD, // Not yet initialized. | 33 UNDEFINED_LOAD, // Not yet initialized. |
39 RELOAD, // User pressed reload. | 34 RELOAD, // User pressed reload. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 162 |
168 const GURL& searchable_form_url() const { return searchable_form_url_; } | 163 const GURL& searchable_form_url() const { return searchable_form_url_; } |
169 void set_searchable_form_url(const GURL& url) { searchable_form_url_ = url; } | 164 void set_searchable_form_url(const GURL& url) { searchable_form_url_ = url; } |
170 const std::string& searchable_form_encoding() const { | 165 const std::string& searchable_form_encoding() const { |
171 return searchable_form_encoding_; | 166 return searchable_form_encoding_; |
172 } | 167 } |
173 void set_searchable_form_encoding(const std::string& encoding) { | 168 void set_searchable_form_encoding(const std::string& encoding) { |
174 searchable_form_encoding_ = encoding; | 169 searchable_form_encoding_ = encoding; |
175 } | 170 } |
176 | 171 |
177 webkit::forms::PasswordForm* password_form_data() const { | 172 PasswordForm* password_form_data() const { |
178 return password_form_data_.get(); | 173 return password_form_data_.get(); |
179 } | 174 } |
180 void set_password_form_data(scoped_ptr<webkit::forms::PasswordForm> data); | 175 void set_password_form_data(scoped_ptr<PasswordForm> data); |
181 | 176 |
182 const std::string& security_info() const { return security_info_; } | 177 const std::string& security_info() const { return security_info_; } |
183 void set_security_info(const std::string& security_info) { | 178 void set_security_info(const std::string& security_info) { |
184 security_info_ = security_info; | 179 security_info_ = security_info; |
185 } | 180 } |
186 | 181 |
187 // True if an error page should be used, if the http status code also | 182 // True if an error page should be used, if the http status code also |
188 // indicates an error. | 183 // indicates an error. |
189 bool use_error_page() const { return use_error_page_; } | 184 bool use_error_page() const { return use_error_page_; } |
190 void set_use_error_page(bool use_error_page) { | 185 void set_use_error_page(bool use_error_page) { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 bool web_timing_histograms_recorded_; | 270 bool web_timing_histograms_recorded_; |
276 int http_status_code_; | 271 int http_status_code_; |
277 bool was_fetched_via_spdy_; | 272 bool was_fetched_via_spdy_; |
278 bool was_npn_negotiated_; | 273 bool was_npn_negotiated_; |
279 std::string npn_negotiated_protocol_; | 274 std::string npn_negotiated_protocol_; |
280 bool was_alternate_protocol_available_; | 275 bool was_alternate_protocol_available_; |
281 bool was_fetched_via_proxy_; | 276 bool was_fetched_via_proxy_; |
282 | 277 |
283 GURL searchable_form_url_; | 278 GURL searchable_form_url_; |
284 std::string searchable_form_encoding_; | 279 std::string searchable_form_encoding_; |
285 scoped_ptr<webkit::forms::PasswordForm> password_form_data_; | 280 scoped_ptr<PasswordForm> password_form_data_; |
286 std::string security_info_; | 281 std::string security_info_; |
287 | 282 |
288 bool use_error_page_; | 283 bool use_error_page_; |
289 | 284 |
290 bool is_overriding_user_agent_; | 285 bool is_overriding_user_agent_; |
291 bool must_reset_scroll_and_scale_state_; | 286 bool must_reset_scroll_and_scale_state_; |
292 | 287 |
293 // A prefetcher is a page that contains link rel=prefetch elements. | 288 // A prefetcher is a page that contains link rel=prefetch elements. |
294 bool was_prefetcher_; | 289 bool was_prefetcher_; |
295 bool was_referred_by_prefetcher_; | 290 bool was_referred_by_prefetcher_; |
296 | 291 |
297 LoadType load_type_; | 292 LoadType load_type_; |
298 | 293 |
299 bool cache_policy_override_set_; | 294 bool cache_policy_override_set_; |
300 WebKit::WebURLRequest::CachePolicy cache_policy_override_; | 295 WebKit::WebURLRequest::CachePolicy cache_policy_override_; |
301 | 296 |
302 bool referrer_policy_set_; | 297 bool referrer_policy_set_; |
303 WebKit::WebReferrerPolicy referrer_policy_; | 298 WebKit::WebReferrerPolicy referrer_policy_; |
304 | 299 |
305 scoped_ptr<webkit_glue::AltErrorPageResourceFetcher> alt_error_page_fetcher_; | 300 scoped_ptr<webkit_glue::AltErrorPageResourceFetcher> alt_error_page_fetcher_; |
306 | 301 |
307 scoped_ptr<NavigationState> navigation_state_; | 302 scoped_ptr<NavigationState> navigation_state_; |
308 }; | 303 }; |
309 | 304 |
310 #endif // CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_ | 305 #endif // CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_ |
311 | 306 |
312 } // namespace content | 307 } // namespace content |
OLD | NEW |