Chromium Code Reviews| 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/i18n/case_conversion.h" | 9 #include "base/i18n/case_conversion.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1046 } | 1046 } |
| 1047 | 1047 |
| 1048 if (password_forms.empty() && !only_visible) { | 1048 if (password_forms.empty() && !only_visible) { |
| 1049 // We need to send the PasswordFormsRendered message regardless of whether | 1049 // We need to send the PasswordFormsRendered message regardless of whether |
| 1050 // there are any forms visible, as this is also the code path that triggers | 1050 // there are any forms visible, as this is also the code path that triggers |
| 1051 // showing the infobar. | 1051 // showing the infobar. |
| 1052 return; | 1052 return; |
| 1053 } | 1053 } |
| 1054 | 1054 |
| 1055 if (only_visible) { | 1055 if (only_visible) { |
| 1056 bool is_last_load = true; | 1056 blink::WebFrame* frame = render_frame()->GetWebFrame()->top(); |
|
vabr (Chromium)
2015/12/17 13:51:48
nit: frame -> main_frame
(to make clearer below, w
dvadym
2015/12/17 14:00:27
It's not necessary the main frame, it might be a t
dvadym
2015/12/17 14:17:40
Thanks, it's really top frame and it makes sense t
| |
| 1057 for (blink::WebFrame* frame = render_frame()->GetWebFrame()->top(); frame; | 1057 bool did_stop_loading = !frame || !frame->isLoading(); |
| 1058 frame = frame->traverseNext(false)) { | |
| 1059 if (frame != render_frame()->GetWebFrame() && frame->isLoading()) { | |
| 1060 is_last_load = false; | |
| 1061 break; | |
| 1062 } | |
| 1063 } | |
| 1064 Send(new AutofillHostMsg_PasswordFormsRendered(routing_id(), password_forms, | 1058 Send(new AutofillHostMsg_PasswordFormsRendered(routing_id(), password_forms, |
| 1065 is_last_load)); | 1059 did_stop_loading)); |
| 1066 } else { | 1060 } else { |
| 1067 Send(new AutofillHostMsg_PasswordFormsParsed(routing_id(), password_forms)); | 1061 Send(new AutofillHostMsg_PasswordFormsParsed(routing_id(), password_forms)); |
| 1068 } | 1062 } |
| 1069 } | 1063 } |
| 1070 | 1064 |
| 1071 bool PasswordAutofillAgent::OnMessageReceived(const IPC::Message& message) { | 1065 bool PasswordAutofillAgent::OnMessageReceived(const IPC::Message& message) { |
| 1072 bool handled = true; | 1066 bool handled = true; |
| 1073 IPC_BEGIN_MESSAGE_MAP(PasswordAutofillAgent, message) | 1067 IPC_BEGIN_MESSAGE_MAP(PasswordAutofillAgent, message) |
| 1074 IPC_MESSAGE_HANDLER(AutofillMsg_FillPasswordForm, OnFillPasswordForm) | 1068 IPC_MESSAGE_HANDLER(AutofillMsg_FillPasswordForm, OnFillPasswordForm) |
| 1075 IPC_MESSAGE_HANDLER(AutofillMsg_SetLoggingState, OnSetLoggingState) | 1069 IPC_MESSAGE_HANDLER(AutofillMsg_SetLoggingState, OnSetLoggingState) |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1503 } | 1497 } |
| 1504 | 1498 |
| 1505 bool PasswordAutofillAgent::ProvisionallySavedPasswordIsValid() { | 1499 bool PasswordAutofillAgent::ProvisionallySavedPasswordIsValid() { |
| 1506 return provisionally_saved_form_ && | 1500 return provisionally_saved_form_ && |
| 1507 !provisionally_saved_form_->username_value.empty() && | 1501 !provisionally_saved_form_->username_value.empty() && |
| 1508 !(provisionally_saved_form_->password_value.empty() && | 1502 !(provisionally_saved_form_->password_value.empty() && |
| 1509 provisionally_saved_form_->new_password_value.empty()); | 1503 provisionally_saved_form_->new_password_value.empty()); |
| 1510 } | 1504 } |
| 1511 | 1505 |
| 1512 } // namespace autofill | 1506 } // namespace autofill |
| OLD | NEW |