| 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 28 matching lines...) Expand all Loading... |
| 39 #include "third_party/WebKit/public/web/WebFormControlElement.h" | 39 #include "third_party/WebKit/public/web/WebFormControlElement.h" |
| 40 #include "third_party/WebKit/public/web/WebFormElement.h" | 40 #include "third_party/WebKit/public/web/WebFormElement.h" |
| 41 #include "third_party/WebKit/public/web/WebInputEvent.h" | 41 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 42 #include "third_party/WebKit/public/web/WebLocalFrame.h" | 42 #include "third_party/WebKit/public/web/WebLocalFrame.h" |
| 43 #include "third_party/WebKit/public/web/WebNode.h" | 43 #include "third_party/WebKit/public/web/WebNode.h" |
| 44 #include "third_party/WebKit/public/web/WebOptionElement.h" | 44 #include "third_party/WebKit/public/web/WebOptionElement.h" |
| 45 #include "third_party/WebKit/public/web/WebTextAreaElement.h" | 45 #include "third_party/WebKit/public/web/WebTextAreaElement.h" |
| 46 #include "third_party/WebKit/public/web/WebView.h" | 46 #include "third_party/WebKit/public/web/WebView.h" |
| 47 #include "ui/base/l10n/l10n_util.h" | 47 #include "ui/base/l10n/l10n_util.h" |
| 48 #include "ui/events/keycodes/keyboard_codes.h" | 48 #include "ui/events/keycodes/keyboard_codes.h" |
| 49 #include "url/url_constants.h" |
| 49 | 50 |
| 50 using blink::WebAutofillClient; | 51 using blink::WebAutofillClient; |
| 51 using blink::WebConsoleMessage; | 52 using blink::WebConsoleMessage; |
| 52 using blink::WebElement; | 53 using blink::WebElement; |
| 53 using blink::WebElementCollection; | 54 using blink::WebElementCollection; |
| 54 using blink::WebFormControlElement; | 55 using blink::WebFormControlElement; |
| 55 using blink::WebFormElement; | 56 using blink::WebFormElement; |
| 56 using blink::WebFrame; | 57 using blink::WebFrame; |
| 57 using blink::WebInputElement; | 58 using blink::WebInputElement; |
| 58 using blink::WebKeyboardEvent; | 59 using blink::WebKeyboardEvent; |
| (...skipping 214 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(url::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 = |
| (...skipping 406 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 |