| 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 | 7 |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/common/page_transition_types.h" | 10 #include "chrome/common/page_transition_types.h" |
| 11 #include "webkit/api/public/WebDataSource.h" | 11 #include "webkit/api/public/WebDataSource.h" |
| 12 #include "webkit/glue/alt_error_page_resource_fetcher.h" | 12 #include "webkit/glue/alt_error_page_resource_fetcher.h" |
| 13 #include "webkit/glue/password_form.h" | 13 #include "webkit/glue/password_form.h" |
| 14 #include "webkit/glue/searchable_form_data.h" | |
| 15 | 14 |
| 16 // The RenderView stores an instance of this class in the "extra data" of each | 15 // The RenderView stores an instance of this class in the "extra data" of each |
| 17 // WebDataSource (see RenderView::DidCreateDataSource). | 16 // WebDataSource (see RenderView::DidCreateDataSource). |
| 18 class NavigationState : public WebKit::WebDataSource::ExtraData { | 17 class NavigationState : public WebKit::WebDataSource::ExtraData { |
| 19 public: | 18 public: |
| 20 static NavigationState* CreateBrowserInitiated( | 19 static NavigationState* CreateBrowserInitiated( |
| 21 int32 pending_page_id, | 20 int32 pending_page_id, |
| 22 PageTransition::Type transition_type, | 21 PageTransition::Type transition_type, |
| 23 base::Time request_time) { | 22 base::Time request_time) { |
| 24 return new NavigationState(transition_type, request_time, false, | 23 return new NavigationState(transition_type, request_time, false, |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 } | 108 } |
| 110 | 109 |
| 111 // True if we have already processed the "DidCommitLoad" event for this | 110 // True if we have already processed the "DidCommitLoad" event for this |
| 112 // request. Used by session history. | 111 // request. Used by session history. |
| 113 bool request_committed() const { return request_committed_; } | 112 bool request_committed() const { return request_committed_; } |
| 114 void set_request_committed(bool value) { request_committed_ = value; } | 113 void set_request_committed(bool value) { request_committed_ = value; } |
| 115 | 114 |
| 116 // True if this navigation was not initiated via WebFrame::LoadRequest. | 115 // True if this navigation was not initiated via WebFrame::LoadRequest. |
| 117 bool is_content_initiated() const { return is_content_initiated_; } | 116 bool is_content_initiated() const { return is_content_initiated_; } |
| 118 | 117 |
| 119 webkit_glue::SearchableFormData* searchable_form_data() const { | 118 const GURL& searchable_form_url() const { return searchable_form_url_; } |
| 120 return searchable_form_data_.get(); | 119 void set_searchable_form_url(const GURL& url) { searchable_form_url_ = url; } |
| 120 const std::string& searchable_form_encoding() const { |
| 121 return searchable_form_encoding_; |
| 121 } | 122 } |
| 122 void set_searchable_form_data(webkit_glue::SearchableFormData* data) { | 123 void set_searchable_form_encoding(const std::string& encoding) { |
| 123 searchable_form_data_.reset(data); | 124 searchable_form_encoding_ = encoding; |
| 124 } | 125 } |
| 125 | 126 |
| 126 webkit_glue::PasswordForm* password_form_data() const { | 127 webkit_glue::PasswordForm* password_form_data() const { |
| 127 return password_form_data_.get(); | 128 return password_form_data_.get(); |
| 128 } | 129 } |
| 129 void set_password_form_data(webkit_glue::PasswordForm* data) { | 130 void set_password_form_data(webkit_glue::PasswordForm* data) { |
| 130 password_form_data_.reset(data); | 131 password_form_data_.reset(data); |
| 131 } | 132 } |
| 132 | 133 |
| 133 webkit_glue::AltErrorPageResourceFetcher* alt_error_page_fetcher() const { | 134 webkit_glue::AltErrorPageResourceFetcher* alt_error_page_fetcher() const { |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 base::Time start_load_time_; | 181 base::Time start_load_time_; |
| 181 base::Time commit_load_time_; | 182 base::Time commit_load_time_; |
| 182 base::Time finish_document_load_time_; | 183 base::Time finish_document_load_time_; |
| 183 base::Time finish_load_time_; | 184 base::Time finish_load_time_; |
| 184 base::Time first_paint_time_; | 185 base::Time first_paint_time_; |
| 185 base::Time first_paint_after_load_time_; | 186 base::Time first_paint_after_load_time_; |
| 186 bool load_histograms_recorded_; | 187 bool load_histograms_recorded_; |
| 187 bool request_committed_; | 188 bool request_committed_; |
| 188 bool is_content_initiated_; | 189 bool is_content_initiated_; |
| 189 int32 pending_page_id_; | 190 int32 pending_page_id_; |
| 190 scoped_ptr<webkit_glue::SearchableFormData> searchable_form_data_; | 191 GURL searchable_form_url_; |
| 192 std::string searchable_form_encoding_; |
| 191 scoped_ptr<webkit_glue::PasswordForm> password_form_data_; | 193 scoped_ptr<webkit_glue::PasswordForm> password_form_data_; |
| 192 scoped_ptr<webkit_glue::AltErrorPageResourceFetcher> alt_error_page_fetcher_; | 194 scoped_ptr<webkit_glue::AltErrorPageResourceFetcher> alt_error_page_fetcher_; |
| 193 std::string security_info_; | 195 std::string security_info_; |
| 194 bool postpone_loading_data_; | 196 bool postpone_loading_data_; |
| 195 std::string postponed_data_; | 197 std::string postponed_data_; |
| 196 | 198 |
| 197 DISALLOW_COPY_AND_ASSIGN(NavigationState); | 199 DISALLOW_COPY_AND_ASSIGN(NavigationState); |
| 198 }; | 200 }; |
| 199 | 201 |
| 200 #endif // CHROME_RENDERER_NAVIGATION_STATE_H_ | 202 #endif // CHROME_RENDERER_NAVIGATION_STATE_H_ |
| OLD | NEW |