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/password_autofill_agent.h" | 5 #include "components/autofill/content/renderer/password_autofill_agent.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 } | 352 } |
353 | 353 |
354 void PasswordAutofillAgent::OnDynamicFormsSeen(blink::WebFrame* frame) { | 354 void PasswordAutofillAgent::OnDynamicFormsSeen(blink::WebFrame* frame) { |
355 SendPasswordForms(frame, false /* only_visible */); | 355 SendPasswordForms(frame, false /* only_visible */); |
356 } | 356 } |
357 | 357 |
358 void PasswordAutofillAgent::SendPasswordForms(blink::WebFrame* frame, | 358 void PasswordAutofillAgent::SendPasswordForms(blink::WebFrame* frame, |
359 bool only_visible) { | 359 bool only_visible) { |
360 // Make sure that this security origin is allowed to use password manager. | 360 // Make sure that this security origin is allowed to use password manager. |
361 blink::WebSecurityOrigin origin = frame->document().securityOrigin(); | 361 blink::WebSecurityOrigin origin = frame->document().securityOrigin(); |
362 if (!OriginCanAccessPasswordManager(origin)) | 362 if (origin.isNull() || !OriginCanAccessPasswordManager(origin)) |
363 return; | 363 return; |
364 | 364 |
365 // Checks whether the webpage is a redirect page or an empty page. | 365 // Checks whether the webpage is a redirect page or an empty page. |
366 if (IsWebpageEmpty(frame)) | 366 if (IsWebpageEmpty(frame)) |
367 return; | 367 return; |
368 | 368 |
369 blink::WebVector<blink::WebFormElement> forms; | 369 blink::WebVector<blink::WebFormElement> forms; |
370 frame->document().forms(forms); | 370 frame->document().forms(forms); |
371 | 371 |
372 std::vector<PasswordForm> password_forms; | 372 std::vector<PasswordForm> password_forms; |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
870 } | 870 } |
871 | 871 |
872 PasswordAutofillAgent::AutofillWebUserGestureHandler:: | 872 PasswordAutofillAgent::AutofillWebUserGestureHandler:: |
873 AutofillWebUserGestureHandler(PasswordAutofillAgent* agent) | 873 AutofillWebUserGestureHandler(PasswordAutofillAgent* agent) |
874 : agent_(agent) {} | 874 : agent_(agent) {} |
875 | 875 |
876 PasswordAutofillAgent::AutofillWebUserGestureHandler:: | 876 PasswordAutofillAgent::AutofillWebUserGestureHandler:: |
877 ~AutofillWebUserGestureHandler() {} | 877 ~AutofillWebUserGestureHandler() {} |
878 | 878 |
879 } // namespace autofill | 879 } // namespace autofill |
OLD | NEW |