OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #include "components/autofill/content/renderer/autofill_agent.h" | 5 #include "components/autofill/content/renderer/autofill_agent.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "components/autofill/core/common/form_data.h" | 22 #include "components/autofill/core/common/form_data.h" |
23 #include "components/autofill/core/common/form_data_predictions.h" | 23 #include "components/autofill/core/common/form_data_predictions.h" |
24 #include "components/autofill/core/common/form_field_data.h" | 24 #include "components/autofill/core/common/form_field_data.h" |
25 #include "components/autofill/core/common/password_form.h" | 25 #include "components/autofill/core/common/password_form.h" |
26 #include "components/autofill/core/common/web_element_descriptor.h" | 26 #include "components/autofill/core/common/web_element_descriptor.h" |
27 #include "content/public/common/content_switches.h" | 27 #include "content/public/common/content_switches.h" |
28 #include "content/public/common/ssl_status.h" | 28 #include "content/public/common/ssl_status.h" |
29 #include "content/public/common/url_constants.h" | 29 #include "content/public/common/url_constants.h" |
30 #include "content/public/renderer/render_view.h" | 30 #include "content/public/renderer/render_view.h" |
31 #include "grit/component_strings.h" | 31 #include "grit/component_strings.h" |
| 32 #include "net/base/url_constants.h" |
32 #include "net/cert/cert_status_flags.h" | 33 #include "net/cert/cert_status_flags.h" |
33 #include "third_party/WebKit/public/platform/WebRect.h" | 34 #include "third_party/WebKit/public/platform/WebRect.h" |
34 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 35 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
35 #include "third_party/WebKit/public/web/WebConsoleMessage.h" | 36 #include "third_party/WebKit/public/web/WebConsoleMessage.h" |
36 #include "third_party/WebKit/public/web/WebDataSource.h" | 37 #include "third_party/WebKit/public/web/WebDataSource.h" |
37 #include "third_party/WebKit/public/web/WebDocument.h" | 38 #include "third_party/WebKit/public/web/WebDocument.h" |
38 #include "third_party/WebKit/public/web/WebElementCollection.h" | 39 #include "third_party/WebKit/public/web/WebElementCollection.h" |
39 #include "third_party/WebKit/public/web/WebFormControlElement.h" | 40 #include "third_party/WebKit/public/web/WebFormControlElement.h" |
40 #include "third_party/WebKit/public/web/WebFormElement.h" | 41 #include "third_party/WebKit/public/web/WebFormElement.h" |
41 #include "third_party/WebKit/public/web/WebInputEvent.h" | 42 #include "third_party/WebKit/public/web/WebInputEvent.h" |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
273 const blink::WebAutocompleteParams& details) { | 274 const blink::WebAutocompleteParams& details) { |
274 // TODO(estade): honor |details|. | 275 // TODO(estade): honor |details|. |
275 | 276 |
276 // Disallow the dialog over non-https or broken https, except when the | 277 // Disallow the dialog over non-https or broken https, except when the |
277 // ignore SSL flag is passed. See http://crbug.com/272512. | 278 // ignore SSL flag is passed. See http://crbug.com/272512. |
278 // TODO(palmer): this should be moved to the browser process after frames | 279 // TODO(palmer): this should be moved to the browser process after frames |
279 // get their own processes. | 280 // get their own processes. |
280 GURL url(form.document().url()); | 281 GURL url(form.document().url()); |
281 content::SSLStatus ssl_status = | 282 content::SSLStatus ssl_status = |
282 render_view()->GetSSLStatusOfFrame(form.document().frame()); | 283 render_view()->GetSSLStatusOfFrame(form.document().frame()); |
283 bool is_safe = url.SchemeIs(content::kHttpsScheme) && | 284 bool is_safe = url.SchemeIs(net::kHttpsScheme) && |
284 !net::IsCertStatusError(ssl_status.cert_status); | 285 !net::IsCertStatusError(ssl_status.cert_status); |
285 bool allow_unsafe = CommandLine::ForCurrentProcess()->HasSwitch( | 286 bool allow_unsafe = CommandLine::ForCurrentProcess()->HasSwitch( |
286 ::switches::kReduceSecurityForTesting); | 287 ::switches::kReduceSecurityForTesting); |
287 | 288 |
288 FormData form_data; | 289 FormData form_data; |
289 std::string error_message; | 290 std::string error_message; |
290 if (!in_flight_request_form_.isNull()) { | 291 if (!in_flight_request_form_.isNull()) { |
291 error_message = "already active."; | 292 error_message = "already active."; |
292 } else if (!is_safe && !allow_unsafe) { | 293 } else if (!is_safe && !allow_unsafe) { |
293 error_message = | 294 error_message = |
294 "must use a secure connection or --reduce-security-for-testing."; | 295 "must use a secure connection or --reduce-security-for-testing."; |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 // Only monitors dynamic forms created in the top frame. Dynamic forms | 701 // Only monitors dynamic forms created in the top frame. Dynamic forms |
701 // inserted in iframes are not captured yet. | 702 // inserted in iframes are not captured yet. |
702 if (frame && !frame->parent()) { | 703 if (frame && !frame->parent()) { |
703 password_autofill_agent_->OnDynamicFormsSeen(frame); | 704 password_autofill_agent_->OnDynamicFormsSeen(frame); |
704 return; | 705 return; |
705 } | 706 } |
706 } | 707 } |
707 } | 708 } |
708 | 709 |
709 } // namespace autofill | 710 } // namespace autofill |
OLD | NEW |