| 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 CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 const std::vector<content::PasswordForm>& visible_forms); | 82 const std::vector<content::PasswordForm>& visible_forms); |
| 83 | 83 |
| 84 protected: | 84 protected: |
| 85 // Subclassed for unit tests. | 85 // Subclassed for unit tests. |
| 86 PasswordManager(content::WebContents* web_contents, | 86 PasswordManager(content::WebContents* web_contents, |
| 87 PasswordManagerDelegate* delegate); | 87 PasswordManagerDelegate* delegate); |
| 88 | 88 |
| 89 private: | 89 private: |
| 90 friend class content::WebContentsUserData<PasswordManager>; | 90 friend class content::WebContentsUserData<PasswordManager>; |
| 91 | 91 |
| 92 enum ProvisionalSaveFailure { |
| 93 SAVING_DISABLED, |
| 94 EMPTY_PASSWORD, |
| 95 NO_MATCHING_FORM, |
| 96 MATCHING_NOT_COMPLETE, |
| 97 FORM_BLACKLISTED, |
| 98 INVALID_FORM, |
| 99 AUTOCOMPLETE_OFF, |
| 100 MAX_FAILURE_VALUE |
| 101 }; |
| 102 |
| 103 // Log failure for UMA |
| 104 void RecordFailure(ProvisionalSaveFailure failure); |
| 105 |
| 92 // Possibly set up FieldTrial for testing other possible usernames. This only | 106 // Possibly set up FieldTrial for testing other possible usernames. This only |
| 93 // happens if there are other_possible_usernames to be shown and the | 107 // happens if there are other_possible_usernames to be shown and the |
| 94 // experiment hasn't already been initialized. We setup the experiment at | 108 // experiment hasn't already been initialized. We setup the experiment at |
| 95 // such a late time because this experiment will only affect a small number | 109 // such a late time because this experiment will only affect a small number |
| 96 // of users so we want to include a larger fraction of these users than the | 110 // of users so we want to include a larger fraction of these users than the |
| 97 // normal 10%. | 111 // normal 10%. |
| 98 void PossiblyInitializeUsernamesExperiment( | 112 void PossiblyInitializeUsernamesExperiment( |
| 99 const content::PasswordFormMap& matches) const; | 113 const content::PasswordFormMap& matches) const; |
| 100 | 114 |
| 101 // Returns true if we can show possible usernames to users in cases where | 115 // Returns true if we can show possible usernames to users in cases where |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 BooleanPrefMember password_manager_enabled_; | 153 BooleanPrefMember password_manager_enabled_; |
| 140 | 154 |
| 141 // Observers to be notified of LoginModel events. This is mutable to allow | 155 // Observers to be notified of LoginModel events. This is mutable to allow |
| 142 // notification in const member functions. | 156 // notification in const member functions. |
| 143 mutable ObserverList<LoginModelObserver> observers_; | 157 mutable ObserverList<LoginModelObserver> observers_; |
| 144 | 158 |
| 145 DISALLOW_COPY_AND_ASSIGN(PasswordManager); | 159 DISALLOW_COPY_AND_ASSIGN(PasswordManager); |
| 146 }; | 160 }; |
| 147 | 161 |
| 148 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_H_ | 162 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_H_ |
| OLD | NEW |