| 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_IOS_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 5 #ifndef IOS_CHROME_BROWSER_PASSWORDS_IOS_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
| 6 #define IOS_CHROME_BROWSER_PASSWORDS_IOS_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 6 #define IOS_CHROME_BROWSER_PASSWORDS_IOS_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #import "components/password_manager/core/browser/password_manager_client.h" | 9 #import "components/password_manager/core/browser/password_manager_client.h" |
| 10 #include "components/password_manager/sync/browser/sync_credentials_filter.h" | 10 #include "components/password_manager/sync/browser/sync_credentials_filter.h" |
| 11 #include "components/prefs/pref_member.h" | 11 #include "components/prefs/pref_member.h" |
| 12 | 12 |
| 13 namespace ios { | 13 namespace ios { |
| 14 class ChromeBrowserState; | 14 class ChromeBrowserState; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace password_manager { | 17 namespace password_manager { |
| 18 class PasswordFormManager; | 18 class PasswordFormManager; |
| 19 } | 19 } |
| 20 | 20 |
| 21 @protocol PasswordManagerClientDelegate | 21 @protocol PasswordManagerClientDelegate |
| 22 | 22 |
| 23 // Shows UI to prompt the user to save the password. | 23 // Shows UI to prompt the user to save the password. |
| 24 - (void)showSavePasswordInfoBar: | 24 - (void)showSavePasswordInfoBar: |
| 25 (std::unique_ptr<password_manager::PasswordFormManager>)formToSave; | 25 (std::unique_ptr<password_manager::PasswordFormManager>)formToSave; |
| 26 | 26 |
| 27 // Shows UI to prompt the user to update the password. |
| 28 - (void)showUpdatePasswordInfoBar: |
| 29 (std::unique_ptr<password_manager::PasswordFormManager>)formToUpdate; |
| 30 |
| 27 @property(readonly, nonatomic) ios::ChromeBrowserState* browserState; | 31 @property(readonly, nonatomic) ios::ChromeBrowserState* browserState; |
| 28 | 32 |
| 29 @property(readonly, nonatomic) const GURL& lastCommittedURL; | 33 @property(readonly, nonatomic) const GURL& lastCommittedURL; |
| 30 | 34 |
| 31 @end | 35 @end |
| 32 | 36 |
| 33 // An iOS implementation of password_manager::PasswordManagerClient. | 37 // An iOS implementation of password_manager::PasswordManagerClient. |
| 34 class IOSChromePasswordManagerClient | 38 class IOSChromePasswordManagerClient |
| 35 : public password_manager::PasswordManagerClient { | 39 : public password_manager::PasswordManagerClient { |
| 36 public: | 40 public: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 58 password_manager::PasswordStore* GetPasswordStore() const override; | 62 password_manager::PasswordStore* GetPasswordStore() const override; |
| 59 void NotifyUserAutoSignin(ScopedVector<autofill::PasswordForm> local_forms, | 63 void NotifyUserAutoSignin(ScopedVector<autofill::PasswordForm> local_forms, |
| 60 const GURL& origin) override; | 64 const GURL& origin) override; |
| 61 void NotifyUserCouldBeAutoSignedIn( | 65 void NotifyUserCouldBeAutoSignedIn( |
| 62 std::unique_ptr<autofill::PasswordForm> form) override; | 66 std::unique_ptr<autofill::PasswordForm> form) override; |
| 63 void NotifySuccessfulLoginWithExistingPassword( | 67 void NotifySuccessfulLoginWithExistingPassword( |
| 64 const autofill::PasswordForm& form) override; | 68 const autofill::PasswordForm& form) override; |
| 65 void NotifyStorePasswordCalled() override; | 69 void NotifyStorePasswordCalled() override; |
| 66 void ForceSavePassword() override; | 70 void ForceSavePassword() override; |
| 67 bool IsSavingAndFillingEnabledForCurrentPage() const override; | 71 bool IsSavingAndFillingEnabledForCurrentPage() const override; |
| 72 bool IsUpdatePasswordUIEnabled() const override; |
| 68 const GURL& GetLastCommittedEntryURL() const override; | 73 const GURL& GetLastCommittedEntryURL() const override; |
| 69 const password_manager::CredentialsFilter* GetStoreResultFilter() | 74 const password_manager::CredentialsFilter* GetStoreResultFilter() |
| 70 const override; | 75 const override; |
| 71 | 76 |
| 72 private: | 77 private: |
| 73 id<PasswordManagerClientDelegate> delegate_; // (weak) | 78 id<PasswordManagerClientDelegate> delegate_; // (weak) |
| 74 | 79 |
| 75 // The preference associated with | 80 // The preference associated with |
| 76 // password_manager::prefs::kPasswordManagerSavingEnabled. | 81 // password_manager::prefs::kPasswordManagerSavingEnabled. |
| 77 BooleanPrefMember saving_passwords_enabled_; | 82 BooleanPrefMember saving_passwords_enabled_; |
| 78 | 83 |
| 79 const password_manager::SyncCredentialsFilter credentials_filter_; | 84 const password_manager::SyncCredentialsFilter credentials_filter_; |
| 80 | 85 |
| 81 DISALLOW_COPY_AND_ASSIGN(IOSChromePasswordManagerClient); | 86 DISALLOW_COPY_AND_ASSIGN(IOSChromePasswordManagerClient); |
| 82 }; | 87 }; |
| 83 | 88 |
| 84 #endif // IOS_CHROME_BROWSER_PASSWORDS_IOS_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 89 #endif // IOS_CHROME_BROWSER_PASSWORDS_IOS_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
| OLD | NEW |