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 CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_UTIL_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_UTIL_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_UTIL_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_UTIL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "components/password_manager/core/browser/password_manager_client.h" | |
10 #include "ui/gfx/native_widget_types.h" | 11 #include "ui/gfx/native_widget_types.h" |
11 | 12 |
13 class ProfileSyncService; | |
14 | |
12 namespace password_manager_util { | 15 namespace password_manager_util { |
13 | 16 |
14 enum OsPasswordStatus { | 17 enum OsPasswordStatus { |
15 PASSWORD_STATUS_UNKNOWN = 0, | 18 PASSWORD_STATUS_UNKNOWN = 0, |
16 PASSWORD_STATUS_UNSUPPORTED, | 19 PASSWORD_STATUS_UNSUPPORTED, |
17 PASSWORD_STATUS_BLANK, | 20 PASSWORD_STATUS_BLANK, |
18 PASSWORD_STATUS_NONBLANK, | 21 PASSWORD_STATUS_NONBLANK, |
19 PASSWORD_STATUS_WIN_DOMAIN, | 22 PASSWORD_STATUS_WIN_DOMAIN, |
20 // NOTE: Add new status types only immediately above this line. Also, | 23 // NOTE: Add new status types only immediately above this line. Also, |
21 // make sure the enum list in tools/histogram/histograms.xml is | 24 // make sure the enum list in tools/histogram/histograms.xml is |
22 // updated with any change in here. | 25 // updated with any change in here. |
23 MAX_PASSWORD_STATUS | 26 MAX_PASSWORD_STATUS |
24 }; | 27 }; |
25 | 28 |
26 // Attempts to (re-)authenticate the user of the OS account. Returns true if | 29 // Attempts to (re-)authenticate the user of the OS account. Returns true if |
27 // the user was successfully authenticated, or if authentication was not | 30 // the user was successfully authenticated, or if authentication was not |
28 // possible. On platforms where reauthentication is not possible or does not | 31 // possible. On platforms where reauthentication is not possible or does not |
29 // make sense, the default implementation always returns true. | 32 // make sense, the default implementation always returns true. |
30 bool AuthenticateUser(gfx::NativeWindow window); | 33 bool AuthenticateUser(gfx::NativeWindow window); |
31 | 34 |
32 // Query the system to determine whether the current logged on user has a | 35 // Query the system to determine whether the current logged on user has a |
33 // password set on their OS account. It should be called on UI thread. |reply| | 36 // password set on their OS account. It should be called on UI thread. |reply| |
34 // is invoked on UI thread with result. | 37 // is invoked on UI thread with result. |
35 void GetOsPasswordStatus(const base::Callback<void(OsPasswordStatus)>& reply); | 38 void GetOsPasswordStatus(const base::Callback<void(OsPasswordStatus)>& reply); |
36 | 39 |
40 // Reports whether and how passwords are currently synced. | |
engedy
2015/05/13 14:41:20
nit: We should clarify in the comments that |sync_
vabr (Chromium)
2015/05/13 14:55:06
Done.
| |
41 password_manager::PasswordSyncState GetPasswordSyncState( | |
42 const ProfileSyncService* sync_service); | |
43 | |
37 } // namespace password_manager_util | 44 } // namespace password_manager_util |
38 | 45 |
39 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_UTIL_H_ | 46 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_UTIL_H_ |
OLD | NEW |