OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_STORE_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 | 44 |
45 namespace password_manager { | 45 namespace password_manager { |
46 | 46 |
47 class PasswordManagerClient; | 47 class PasswordManagerClient; |
48 class PasswordStoreConsumer; | 48 class PasswordStoreConsumer; |
49 class PasswordSyncableService; | 49 class PasswordSyncableService; |
50 | 50 |
51 // Interface for storing form passwords in a platform-specific secure way. | 51 // Interface for storing form passwords in a platform-specific secure way. |
52 // The login request/manipulation API is not threadsafe and must be used | 52 // The login request/manipulation API is not threadsafe and must be used |
53 // from the UI thread. | 53 // from the UI thread. |
| 54 // Implementations, however, should carry out most tasks asynchronously on a |
| 55 // background thread: the base class provides functionality to facilitate this. |
| 56 // I/O heavy initialization should also be performed asynchronously in this |
| 57 // manner. If this deferred initialization fails, all subsequent method calls |
| 58 // should fail without side effects, return no data, and send no notifications. |
54 // PasswordStoreSync is a hidden base class because only PasswordSyncableService | 59 // PasswordStoreSync is a hidden base class because only PasswordSyncableService |
55 // needs to access these methods. | 60 // needs to access these methods. |
56 class PasswordStore : protected PasswordStoreSync, | 61 class PasswordStore : protected PasswordStoreSync, |
57 public base::RefCountedThreadSafe<PasswordStore> { | 62 public base::RefCountedThreadSafe<PasswordStore> { |
58 public: | 63 public: |
59 // Whether or not it's acceptable for Chrome to request access to locked | 64 // Whether or not it's acceptable for Chrome to request access to locked |
60 // passwords, which requires prompting the user for permission. | 65 // passwords, which requires prompting the user for permission. |
61 enum AuthorizationPromptPolicy { ALLOW_PROMPT, DISALLOW_PROMPT }; | 66 enum AuthorizationPromptPolicy { ALLOW_PROMPT, DISALLOW_PROMPT }; |
62 | 67 |
63 // PasswordForm vector elements are meant to be owned by the | 68 // PasswordForm vector elements are meant to be owned by the |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 scoped_ptr<PasswordSyncableService> syncable_service_; | 308 scoped_ptr<PasswordSyncableService> syncable_service_; |
304 | 309 |
305 bool shutdown_called_; | 310 bool shutdown_called_; |
306 | 311 |
307 DISALLOW_COPY_AND_ASSIGN(PasswordStore); | 312 DISALLOW_COPY_AND_ASSIGN(PasswordStore); |
308 }; | 313 }; |
309 | 314 |
310 } // namespace password_manager | 315 } // namespace password_manager |
311 | 316 |
312 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ | 317 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_STORE_H_ |
OLD | NEW |