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/supports_user_data.h" | 12 #include "base/supports_user_data.h" |
13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "net/http/http_response_info.h" | 15 #include "net/http/http_response_info.h" |
16 #include "third_party/WebKit/public/web/WebDataSource.h" | 16 #include "third_party/WebKit/public/web/WebDataSource.h" |
17 | 17 |
18 namespace content { | 18 namespace content { |
19 | 19 |
20 class NavigationState; | 20 class NavigationState; |
21 struct PasswordForm; | |
22 | 21 |
23 // The RenderView stores an instance of this class in the "extra data" of each | 22 // The RenderView stores an instance of this class in the "extra data" of each |
24 // WebDataSource (see RenderView::DidCreateDataSource). | 23 // WebDataSource (see RenderView::DidCreateDataSource). |
25 class CONTENT_EXPORT DocumentState | 24 class CONTENT_EXPORT DocumentState |
26 : NON_EXPORTED_BASE(public WebKit::WebDataSource::ExtraData), | 25 : NON_EXPORTED_BASE(public WebKit::WebDataSource::ExtraData), |
27 public base::SupportsUserData { | 26 public base::SupportsUserData { |
28 public: | 27 public: |
29 // The exact values of this enum are used in histograms, so new values must be | 28 // The exact values of this enum are used in histograms, so new values must be |
30 // added to the end. | 29 // added to the end. |
31 enum LoadType { | 30 enum LoadType { |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 void set_connection_info( | 154 void set_connection_info( |
156 net::HttpResponseInfo::ConnectionInfo connection_info) { | 155 net::HttpResponseInfo::ConnectionInfo connection_info) { |
157 connection_info_ = connection_info; | 156 connection_info_ = connection_info; |
158 } | 157 } |
159 | 158 |
160 bool was_fetched_via_proxy() const { return was_fetched_via_proxy_; } | 159 bool was_fetched_via_proxy() const { return was_fetched_via_proxy_; } |
161 void set_was_fetched_via_proxy(bool value) { | 160 void set_was_fetched_via_proxy(bool value) { |
162 was_fetched_via_proxy_ = value; | 161 was_fetched_via_proxy_ = value; |
163 } | 162 } |
164 | 163 |
165 // If set, contains the PasswordForm that we believe triggered the current | |
166 // navigation (there is some ambiguity in the case of javascript initiated | |
167 // navigations). This information is used by the PasswordManager to determine | |
168 // if the user should be prompted to save their password. | |
169 // | |
170 // Note that setting this field doesn't affect where the data is sent or what | |
171 // origin we associate it with, only whether we prompt the user to save it. | |
172 // That is, a false positive is a usability issue (e.g. may try to save a | |
173 // mis-typed password) not a security issue. | |
174 PasswordForm* password_form_data() const { | |
175 return password_form_data_.get(); | |
176 } | |
177 void set_password_form_data(scoped_ptr<PasswordForm> data); | |
178 | |
179 void set_was_prefetcher(bool value) { was_prefetcher_ = value; } | 164 void set_was_prefetcher(bool value) { was_prefetcher_ = value; } |
180 bool was_prefetcher() const { return was_prefetcher_; } | 165 bool was_prefetcher() const { return was_prefetcher_; } |
181 | 166 |
182 void set_was_referred_by_prefetcher(bool value) { | 167 void set_was_referred_by_prefetcher(bool value) { |
183 was_referred_by_prefetcher_ = value; | 168 was_referred_by_prefetcher_ = value; |
184 } | 169 } |
185 bool was_referred_by_prefetcher() const { | 170 bool was_referred_by_prefetcher() const { |
186 return was_referred_by_prefetcher_; | 171 return was_referred_by_prefetcher_; |
187 } | 172 } |
188 | 173 |
(...skipping 24 matching lines...) Expand all Loading... |
213 base::Time first_paint_after_load_time_; | 198 base::Time first_paint_after_load_time_; |
214 bool load_histograms_recorded_; | 199 bool load_histograms_recorded_; |
215 bool web_timing_histograms_recorded_; | 200 bool web_timing_histograms_recorded_; |
216 bool was_fetched_via_spdy_; | 201 bool was_fetched_via_spdy_; |
217 bool was_npn_negotiated_; | 202 bool was_npn_negotiated_; |
218 std::string npn_negotiated_protocol_; | 203 std::string npn_negotiated_protocol_; |
219 bool was_alternate_protocol_available_; | 204 bool was_alternate_protocol_available_; |
220 net::HttpResponseInfo::ConnectionInfo connection_info_; | 205 net::HttpResponseInfo::ConnectionInfo connection_info_; |
221 bool was_fetched_via_proxy_; | 206 bool was_fetched_via_proxy_; |
222 | 207 |
223 scoped_ptr<PasswordForm> password_form_data_; | |
224 | |
225 // A prefetcher is a page that contains link rel=prefetch elements. | 208 // A prefetcher is a page that contains link rel=prefetch elements. |
226 bool was_prefetcher_; | 209 bool was_prefetcher_; |
227 bool was_referred_by_prefetcher_; | 210 bool was_referred_by_prefetcher_; |
228 bool was_after_preconnect_request_; | 211 bool was_after_preconnect_request_; |
229 | 212 |
230 LoadType load_type_; | 213 LoadType load_type_; |
231 | 214 |
232 scoped_ptr<NavigationState> navigation_state_; | 215 scoped_ptr<NavigationState> navigation_state_; |
233 | 216 |
234 bool can_load_local_resources_; | 217 bool can_load_local_resources_; |
235 }; | 218 }; |
236 | 219 |
237 #endif // CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_ | 220 #endif // CONTENT_PUBLIC_RENDERER_DOCUMENT_STATE_H_ |
238 | 221 |
239 } // namespace content | 222 } // namespace content |
OLD | NEW |