Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(35)

Side by Side Diff: components/autofill/content/renderer/provisionally_saved_password_form.cc

Issue 2859243004: Add metrics for PasswordForm submission types (Closed)
Patch Set: addressed reviewer comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698