OLD | NEW |
| (Empty) |
1 // Copyright 2015 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 COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_CREDENTIAL_MANAGER_PENDING_REQU
IRE_USER_MEDIATION_TASK_H_ | |
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_CREDENTIAL_MANAGER_PENDING_REQU
IRE_USER_MEDIATION_TASK_H_ | |
7 | |
8 #include "base/macros.h" | |
9 #include "components/password_manager/core/browser/password_store.h" | |
10 #include "components/password_manager/core/browser/password_store_consumer.h" | |
11 | |
12 namespace password_manager { | |
13 | |
14 // Handles mediation completion and retrieves embedder-dependent services. | |
15 class CredentialManagerPendingRequireUserMediationTaskDelegate { | |
16 public: | |
17 virtual ~CredentialManagerPendingRequireUserMediationTaskDelegate() {} | |
18 | |
19 // Retrieves the PasswordStore. | |
20 virtual PasswordStore* GetPasswordStore() = 0; | |
21 | |
22 // Finishes mediation tasks. | |
23 virtual void DoneRequiringUserMediation() = 0; | |
24 }; | |
25 | |
26 // Notifies the password store that a list of origins require user mediation. | |
27 class CredentialManagerPendingRequireUserMediationTask | |
28 : public PasswordStoreConsumer { | |
29 public: | |
30 explicit CredentialManagerPendingRequireUserMediationTask( | |
31 CredentialManagerPendingRequireUserMediationTaskDelegate* delegate); | |
32 ~CredentialManagerPendingRequireUserMediationTask() override; | |
33 | |
34 // Adds an origin to require user mediation. | |
35 void AddOrigin(const PasswordStore::FormDigest& form_digest); | |
36 | |
37 private: | |
38 // PasswordStoreConsumer implementation. | |
39 void OnGetPasswordStoreResults( | |
40 std::vector<std::unique_ptr<autofill::PasswordForm>> results) override; | |
41 | |
42 CredentialManagerPendingRequireUserMediationTaskDelegate* const | |
43 delegate_; // Weak. | |
44 | |
45 // Number of password store requests to be resolved. | |
46 int pending_requests_; | |
47 | |
48 DISALLOW_COPY_AND_ASSIGN(CredentialManagerPendingRequireUserMediationTask); | |
49 }; | |
50 | |
51 } // namespace password_manager | |
52 | |
53 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_CREDENTIAL_MANAGER_PENDING_R
EQUIRE_USER_MEDIATION_TASK_H_ | |
OLD | NEW |