| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 kNoOutcome, | 325 kNoOutcome, |
| 326 kNoGenerationElement, | 326 kNoGenerationElement, |
| 327 kFoundGenerationElement | 327 kFoundGenerationElement |
| 328 }; | 328 }; |
| 329 | 329 |
| 330 // The maximum number of combinations of the three preceding enums. | 330 // The maximum number of combinations of the three preceding enums. |
| 331 // This is used when recording the actions taken by the form in UMA. | 331 // This is used when recording the actions taken by the form in UMA. |
| 332 static const int kMaxNumActionsTaken = | 332 static const int kMaxNumActionsTaken = |
| 333 kManagerActionMax * kUserActionMax * kSubmitResultMax; | 333 kManagerActionMax * kUserActionMax * kSubmitResultMax; |
| 334 | 334 |
| 335 // Enumerates whether there was a `suppressed` stored credential, meaning that | 335 // Enumerates whether there were `suppressed` credentials. These are stored |
| 336 // it was not filled because it was for an origin that was similar to, but not | 336 // credentials that were not filled, even though they might be related to the |
| 337 // exactly (or PSL) matching the origin of |observed_form_|. Currently, the | 337 // |observed_form_|. See FormFetcher::GetSuppressed* for details. |
| 338 // only class of suppressed credentials considered are HTTPS credentials not | |
| 339 // filled on the HTTP version of the origin. | |
| 340 // | 338 // |
| 341 // If a suppressed credential exists, it is also recorded whether its username | 339 // If suppressed credentials exist, it is also recorded whether their username |
| 342 // and password matched those entered or filled into the observed form. | 340 // and/or password matched those submitted. |
| 343 enum SuppressedAccountExistence { | 341 enum SuppressedAccountExistence { |
| 344 kSuppressedAccountNone, | 342 kSuppressedAccountNone, |
| 345 // Recorded when there exists a suppressed credential, but there was no | 343 // Recorded when there exists a suppressed account, but there was no |
| 346 // submitted form to compare the username and password to. | 344 // submitted form to compare its username and password to. |
| 347 kSuppressedAccountExists, | 345 kSuppressedAccountExists, |
| 348 // Recorded when there was a submitted form. | 346 // Recorded when there was a submitted form. |
| 349 kSuppressedAccountExistsDifferentUsername, | 347 kSuppressedAccountExistsDifferentUsername, |
| 350 kSuppressedAccountExistsSameUsername, | 348 kSuppressedAccountExistsSameUsername, |
| 351 kSuppressedAccountExistsSameUsernameAndPassword, | 349 kSuppressedAccountExistsSameUsernameAndPassword, |
| 352 kSuppressedAccountExistenceMax, | 350 kSuppressedAccountExistenceMax, |
| 353 }; | 351 }; |
| 354 | 352 |
| 355 // The maximum number of combinations recorded into histograms in the | 353 // The maximum number of combinations recorded into histograms in the |
| 356 // PasswordManager.SuppressedAccount.* family. | 354 // PasswordManager.SuppressedAccount.* family. |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 // Returns true if |form| is a username update of a credential already in | 423 // Returns true if |form| is a username update of a credential already in |
| 426 // |best_matches_|. Sets |pending_credentials_| to the appropriate | 424 // |best_matches_|. Sets |pending_credentials_| to the appropriate |
| 427 // PasswordForm if it returns true. | 425 // PasswordForm if it returns true. |
| 428 bool UpdatePendingCredentialsIfUsernameChanged( | 426 bool UpdatePendingCredentialsIfUsernameChanged( |
| 429 const autofill::PasswordForm& form); | 427 const autofill::PasswordForm& form); |
| 430 | 428 |
| 431 // Converts the "ActionsTaken" fields into an int so they can be logged to | 429 // Converts the "ActionsTaken" fields into an int so they can be logged to |
| 432 // UMA. | 430 // UMA. |
| 433 int GetActionsTaken() const; | 431 int GetActionsTaken() const; |
| 434 | 432 |
| 435 // Computes statistics on whether there was a stored credential with the | 433 // When supplied with the list of all |suppressed_forms| that belong to |
| 436 // specified |type| that could not be filled into the |observed_form_| because | 434 // certain suppressed credential type (see FormFetcher::GetSuppressed*), |
| 437 // the scheme of its origin was HTTPS rather than HTTP; and encodes this | 435 // filters that list down to forms that are either |manual_or_generated|, and |
| 438 // information into an integer so it can be recorded as a UMA histogram. | 436 // based on that, computes the histogram sample that is a mixed-based |
| 439 int GetStatsForSuppressedHTTPSAccount( | 437 // representation of a combination of four attributes: |
| 440 autofill::PasswordForm::Type type) const; | 438 // -- whether there were suppressed credentials (and if so, their relation to |
| 439 // the submitted username/password). |
| 440 // -- whether the |observed_form_| got ultimately submitted |
| 441 // -- what action the password manager performed (|manager_action_|), |
| 442 // -- and what action the user performed (|user_action_|_). |
| 443 int GetHistogramSampleForSuppressedAccounts( |
| 444 const std::vector<const autofill::PasswordForm*> suppressed_forms, |
| 445 autofill::PasswordForm::Type manual_or_generated) const; |
| 446 |
| 447 // Records all histograms in the PasswordManager.SuppressedAccount.* family. |
| 448 void RecordHistogramsOnSuppressedAccounts() const; |
| 441 | 449 |
| 442 // Tries to set all votes (e.g. autofill field types, generation vote) to | 450 // Tries to set all votes (e.g. autofill field types, generation vote) to |
| 443 // a |FormStructure| and upload it to the server. Returns true on success. | 451 // a |FormStructure| and upload it to the server. Returns true on success. |
| 444 bool UploadPasswordVote(const autofill::PasswordForm& form_to_upload, | 452 bool UploadPasswordVote(const autofill::PasswordForm& form_to_upload, |
| 445 const autofill::ServerFieldType& password_type, | 453 const autofill::ServerFieldType& password_type, |
| 446 const std::string& login_form_signature); | 454 const std::string& login_form_signature); |
| 447 | 455 |
| 448 // Adds a vote on password generation usage to |form_structure|. | 456 // Adds a vote on password generation usage to |form_structure|. |
| 449 void AddGeneratedVote(autofill::FormStructure* form_structure); | 457 void AddGeneratedVote(autofill::FormStructure* form_structure); |
| 450 | 458 |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 643 // True if the main frame's visible URL, at the time this PasswordFormManager | 651 // True if the main frame's visible URL, at the time this PasswordFormManager |
| 644 // was created, is secure. | 652 // was created, is secure. |
| 645 bool is_main_frame_secure_ = false; | 653 bool is_main_frame_secure_ = false; |
| 646 | 654 |
| 647 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); | 655 DISALLOW_COPY_AND_ASSIGN(PasswordFormManager); |
| 648 }; | 656 }; |
| 649 | 657 |
| 650 } // namespace password_manager | 658 } // namespace password_manager |
| 651 | 659 |
| 652 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ | 660 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_FORM_MANAGER_H_ |
| OLD | NEW |