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