OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/provisionally_saved_password_form
.h" | 5 #include "components/autofill/content/renderer/provisionally_saved_password_form
.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "components/autofill/core/common/password_form.h" | |
10 | |
11 namespace autofill { | 9 namespace autofill { |
12 | 10 |
13 ProvisionallySavedPasswordForm::ProvisionallySavedPasswordForm() = default; | 11 ProvisionallySavedPasswordForm::ProvisionallySavedPasswordForm() = default; |
14 | 12 |
15 ProvisionallySavedPasswordForm::~ProvisionallySavedPasswordForm() = default; | 13 ProvisionallySavedPasswordForm::~ProvisionallySavedPasswordForm() = default; |
16 | 14 |
17 void ProvisionallySavedPasswordForm::Set( | 15 void ProvisionallySavedPasswordForm::Set( |
18 std::unique_ptr<PasswordForm> password_form, | 16 std::unique_ptr<PasswordForm> password_form, |
19 const blink::WebFormElement& form_element, | 17 const blink::WebFormElement& form_element, |
20 const blink::WebInputElement& input_element) { | 18 const blink::WebInputElement& input_element) { |
(...skipping 10 matching lines...) Expand all Loading... |
31 | 29 |
32 bool ProvisionallySavedPasswordForm::IsSet() const { | 30 bool ProvisionallySavedPasswordForm::IsSet() const { |
33 return static_cast<bool>(password_form_); | 31 return static_cast<bool>(password_form_); |
34 } | 32 } |
35 | 33 |
36 bool ProvisionallySavedPasswordForm::IsPasswordValid() const { | 34 bool ProvisionallySavedPasswordForm::IsPasswordValid() const { |
37 return IsSet() && !(password_form_->password_value.empty() && | 35 return IsSet() && !(password_form_->password_value.empty() && |
38 password_form_->new_password_value.empty()); | 36 password_form_->new_password_value.empty()); |
39 } | 37 } |
40 | 38 |
| 39 void ProvisionallySavedPasswordForm::SetSubmissionIndicatorEvent( |
| 40 PasswordForm::SubmissionIndicatorEvent event) { |
| 41 if (password_form_) |
| 42 password_form_->submission_event = event; |
| 43 } |
| 44 |
41 } // namespace autofill | 45 } // namespace autofill |
OLD | NEW |