| 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 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_GENERATION_AGENT_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_GENERATION_AGENT_H_ |
| 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_GENERATION_AGENT_H_ | 6 #define COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_GENERATION_AGENT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 // Show UI for editing a generated password at |generation_element_|. | 100 // Show UI for editing a generated password at |generation_element_|. |
| 101 void ShowEditingPopup(); | 101 void ShowEditingPopup(); |
| 102 | 102 |
| 103 // Hides a password generation popup if one exists. | 103 // Hides a password generation popup if one exists. |
| 104 void HidePopup(); | 104 void HidePopup(); |
| 105 | 105 |
| 106 // Sets |generation_element_| to the focused password field and shows a | 106 // Sets |generation_element_| to the focused password field and shows a |
| 107 // generation popup at this field. | 107 // generation popup at this field. |
| 108 void OnUserTriggeredGeneratePassword(); | 108 void OnUserTriggeredGeneratePassword(); |
| 109 | 109 |
| 110 // Enables the form classifier. |
| 111 void OnAllowToRunFormClassifier(); |
| 112 |
| 110 // Runs HTML parsing based classifier and saves its outcome to proto. | 113 // Runs HTML parsing based classifier and saves its outcome to proto. |
| 114 // TODO(crbug.com/621442): Remove client-side form classifier when server-side |
| 115 // classifier is ready. |
| 111 void RunFormClassifierAndSaveVote(const blink::WebFormElement& web_form, | 116 void RunFormClassifierAndSaveVote(const blink::WebFormElement& web_form, |
| 112 const PasswordForm& form); | 117 const PasswordForm& form); |
| 113 | 118 |
| 114 // Creates a password form to presave a generated password. It copies behavior | 119 // Creates a password form to presave a generated password. It copies behavior |
| 115 // of CreatePasswordFormFromWebForm/FromUnownedInputElements, but takes | 120 // of CreatePasswordFormFromWebForm/FromUnownedInputElements, but takes |
| 116 // |password_value| from |generation_element_| and empties |username_value|. | 121 // |password_value| from |generation_element_| and empties |username_value|. |
| 117 // If a form creating is failed, returns an empty unique_ptr. | 122 // If a form creating is failed, returns an empty unique_ptr. |
| 118 std::unique_ptr<PasswordForm> CreatePasswordFormToPresave(); | 123 std::unique_ptr<PasswordForm> CreatePasswordFormToPresave(); |
| 119 | 124 |
| 120 // Stores forms that are candidates for account creation. | 125 // Stores forms that are candidates for account creation. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 bool generation_popup_shown_; | 163 bool generation_popup_shown_; |
| 159 | 164 |
| 160 // True if the editing popup was shown during this navigation. Used to track | 165 // True if the editing popup was shown during this navigation. Used to track |
| 161 // UMA stats per page rather than per display, since the former is more | 166 // UMA stats per page rather than per display, since the former is more |
| 162 // interesting. | 167 // interesting. |
| 163 bool editing_popup_shown_; | 168 bool editing_popup_shown_; |
| 164 | 169 |
| 165 // If this feature is enabled. Controlled by Finch. | 170 // If this feature is enabled. Controlled by Finch. |
| 166 bool enabled_; | 171 bool enabled_; |
| 167 | 172 |
| 173 // If the form classifier should run. |
| 174 bool form_classifier_enabled_; |
| 175 |
| 168 // Unowned pointer. Used to notify PassowrdAutofillAgent when values | 176 // Unowned pointer. Used to notify PassowrdAutofillAgent when values |
| 169 // in password fields are updated. | 177 // in password fields are updated. |
| 170 PasswordAutofillAgent* password_agent_; | 178 PasswordAutofillAgent* password_agent_; |
| 171 | 179 |
| 172 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationAgent); | 180 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationAgent); |
| 173 }; | 181 }; |
| 174 | 182 |
| 175 } // namespace autofill | 183 } // namespace autofill |
| 176 | 184 |
| 177 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_GENERATION_AGENT_H_ | 185 #endif // COMPONENTS_AUTOFILL_CONTENT_RENDERER_PASSWORD_GENERATION_AGENT_H_ |
| OLD | NEW |