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