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

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

Issue 2859243004: Add metrics for PasswordForm submission types (Closed)
Patch Set: Test added 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 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PROVISIONALLY_SAVED_PASSWORD_FORM_H _ 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PROVISIONALLY_SAVED_PASSWORD_FORM_H _
6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PROVISIONALLY_SAVED_PASSWORD_FORM_H _ 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PROVISIONALLY_SAVED_PASSWORD_FORM_H _
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "components/autofill/core/common/password_form.h"
11 #include "third_party/WebKit/public/web/WebInputElement.h" 12 #include "third_party/WebKit/public/web/WebInputElement.h"
12 13
13 namespace autofill { 14 namespace autofill {
14 15
15 struct PasswordForm; 16 struct PasswordForm;
16 17
17 // Represents a possibly submitted password form. 18 // Represents a possibly submitted password form.
18 class ProvisionallySavedPasswordForm { 19 class ProvisionallySavedPasswordForm {
19 public: 20 public:
20 ProvisionallySavedPasswordForm(); 21 ProvisionallySavedPasswordForm();
(...skipping 13 matching lines...) Expand all
34 // filled out. 35 // filled out.
35 bool IsPasswordValid() const; 36 bool IsPasswordValid() const;
36 37
37 const PasswordForm& password_form() const { 38 const PasswordForm& password_form() const {
38 DCHECK(IsSet()); 39 DCHECK(IsSet());
39 return *password_form_; 40 return *password_form_;
40 } 41 }
41 const blink::WebFormElement& form_element() const { return form_element_; } 42 const blink::WebFormElement& form_element() const { return form_element_; }
42 const blink::WebInputElement& input_element() const { return input_element_; } 43 const blink::WebInputElement& input_element() const { return input_element_; }
43 44
45 void SetSubmissionEvent(PasswordForm::SubmissionEvent event);
46
44 private: 47 private:
45 std::unique_ptr<PasswordForm> password_form_; 48 std::unique_ptr<PasswordForm> password_form_;
46 // Last used WebFormElement for the PasswordForm submission. Can be null if 49 // Last used WebFormElement for the PasswordForm submission. Can be null if
47 // the form is unowned. 50 // the form is unowned.
48 blink::WebFormElement form_element_; 51 blink::WebFormElement form_element_;
49 // Last used WebInputElement which led to the PasswordForm update. Can be null 52 // Last used WebInputElement which led to the PasswordForm update. Can be null
50 // if the user has performed a form submission (via a button, for example). 53 // if the user has performed a form submission (via a button, for example).
51 blink::WebInputElement input_element_; 54 blink::WebInputElement input_element_;
52 55
53 DISALLOW_COPY_AND_ASSIGN(ProvisionallySavedPasswordForm); 56 DISALLOW_COPY_AND_ASSIGN(ProvisionallySavedPasswordForm);
54 }; 57 };
55 58
56 } // namespace autofill 59 } // namespace autofill
57 60
58 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PROVISIONALLY_SAVED_PASSWORD_FOR M_H_ 61 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PROVISIONALLY_SAVED_PASSWORD_FOR M_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698