| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 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 IOS_CHROME_BROWSER_PASSWORDS_CREDENTIAL_MANAGER_H_ | 5 #ifndef IOS_CHROME_BROWSER_PASSWORDS_CREDENTIAL_MANAGER_H_ |
| 6 #define IOS_CHROME_BROWSER_PASSWORDS_CREDENTIAL_MANAGER_H_ | 6 #define IOS_CHROME_BROWSER_PASSWORDS_CREDENTIAL_MANAGER_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <string> | 9 #include <string> |
| 9 #include <vector> | 10 #include <vector> |
| 10 | 11 |
| 11 #import "base/mac/scoped_nsobject.h" | 12 #import "base/mac/scoped_nsobject.h" |
| 12 #include "base/macros.h" | 13 #include "base/macros.h" |
| 13 #include "base/memory/scoped_ptr.h" | |
| 14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 15 #include "components/password_manager/core/browser/credential_manager_password_f
orm_manager.h" | 15 #include "components/password_manager/core/browser/credential_manager_password_f
orm_manager.h" |
| 16 #include "components/password_manager/core/browser/credential_manager_pending_re
quest_task.h" | 16 #include "components/password_manager/core/browser/credential_manager_pending_re
quest_task.h" |
| 17 #include "components/password_manager/core/browser/credential_manager_pending_re
quire_user_mediation_task.h" | 17 #include "components/password_manager/core/browser/credential_manager_pending_re
quire_user_mediation_task.h" |
| 18 #include "components/password_manager/core/browser/password_manager_client.h" | 18 #include "components/password_manager/core/browser/password_manager_client.h" |
| 19 #include "components/password_manager/core/browser/password_store.h" | 19 #include "components/password_manager/core/browser/password_store.h" |
| 20 #include "components/prefs/pref_member.h" | 20 #include "components/prefs/pref_member.h" |
| 21 #include "ios/web/public/web_state/web_state_observer.h" | 21 #include "ios/web/public/web_state/web_state_observer.h" |
| 22 | 22 |
| 23 @class JSCredentialManager; | 23 @class JSCredentialManager; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // associated with |request_id_| with the given |error_type|. Invoked after a | 93 // associated with |request_id_| with the given |error_type|. Invoked after a |
| 94 // page-initiated credential event, store, or retrieval fails. | 94 // page-initiated credential event, store, or retrieval fails. |
| 95 void RejectPromise(int request_id, ErrorType error_type); | 95 void RejectPromise(int request_id, ErrorType error_type); |
| 96 | 96 |
| 97 // Determines the currently loaded page's URL from the active WebState, but | 97 // Determines the currently loaded page's URL from the active WebState, but |
| 98 // only if it is absolutely trusted. Does not hit the network, but still might | 98 // only if it is absolutely trusted. Does not hit the network, but still might |
| 99 // be costly depending on the webview. Returns true if successful. | 99 // be costly depending on the webview. Returns true if successful. |
| 100 bool GetUrlWithAbsoluteTrust(GURL* page_url); | 100 bool GetUrlWithAbsoluteTrust(GURL* page_url); |
| 101 | 101 |
| 102 // The request to retrieve credentials from the PasswordStore. | 102 // The request to retrieve credentials from the PasswordStore. |
| 103 scoped_ptr<password_manager::CredentialManagerPendingRequestTask> | 103 std::unique_ptr<password_manager::CredentialManagerPendingRequestTask> |
| 104 pending_request_; | 104 pending_request_; |
| 105 | 105 |
| 106 // The task to notify the password manager that the user was signed out. | 106 // The task to notify the password manager that the user was signed out. |
| 107 scoped_ptr<password_manager::CredentialManagerPendingRequireUserMediationTask> | 107 std::unique_ptr< |
| 108 password_manager::CredentialManagerPendingRequireUserMediationTask> |
| 108 pending_require_user_mediation_; | 109 pending_require_user_mediation_; |
| 109 | 110 |
| 110 // Saves credentials to the PasswordStore. | 111 // Saves credentials to the PasswordStore. |
| 111 scoped_ptr<password_manager::CredentialManagerPasswordFormManager> | 112 std::unique_ptr<password_manager::CredentialManagerPasswordFormManager> |
| 112 form_manager_; | 113 form_manager_; |
| 113 | 114 |
| 114 // Injected JavaScript to provide the API to web pages. | 115 // Injected JavaScript to provide the API to web pages. |
| 115 base::scoped_nsobject<JSCredentialManager> js_manager_; | 116 base::scoped_nsobject<JSCredentialManager> js_manager_; |
| 116 | 117 |
| 117 // Client to access Chrome-specific password manager functionality. Weak. | 118 // Client to access Chrome-specific password manager functionality. Weak. |
| 118 password_manager::PasswordManagerClient* client_; | 119 password_manager::PasswordManagerClient* client_; |
| 119 | 120 |
| 120 // Driver to access embedder-specific password manager functionality. Weak. | 121 // Driver to access embedder-specific password manager functionality. Weak. |
| 121 password_manager::PasswordManagerDriver* driver_; | 122 password_manager::PasswordManagerDriver* driver_; |
| 122 | 123 |
| 123 // Whether zero-click sign-in is enabled. | 124 // Whether zero-click sign-in is enabled. |
| 124 BooleanPrefMember zero_click_sign_in_enabled_; | 125 BooleanPrefMember zero_click_sign_in_enabled_; |
| 125 | 126 |
| 126 // Weak pointer factory for asynchronously resolving requests. | 127 // Weak pointer factory for asynchronously resolving requests. |
| 127 base::WeakPtrFactory<CredentialManager> weak_factory_; | 128 base::WeakPtrFactory<CredentialManager> weak_factory_; |
| 128 | 129 |
| 129 DISALLOW_COPY_AND_ASSIGN(CredentialManager); | 130 DISALLOW_COPY_AND_ASSIGN(CredentialManager); |
| 130 }; | 131 }; |
| 131 | 132 |
| 132 #endif // IOS_CHROME_BROWSER_PASSWORDS_CREDENTIAL_MANAGER_H_ | 133 #endif // IOS_CHROME_BROWSER_PASSWORDS_CREDENTIAL_MANAGER_H_ |
| OLD | NEW |