| 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 CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
| 6 #define CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
| 7 | 7 |
| 8 #include <memory> |
| 8 #include <vector> | 9 #include <vector> |
| 9 | 10 |
| 10 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 11 #include "base/macros.h" | 12 #include "base/macros.h" |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "base/memory/scoped_vector.h" | 13 #include "base/memory/scoped_vector.h" |
| 14 #include "components/password_manager/content/browser/content_password_manager_d
river_factory.h" | 14 #include "components/password_manager/content/browser/content_password_manager_d
river_factory.h" |
| 15 #include "components/password_manager/content/browser/credential_manager_dispatc
her.h" | 15 #include "components/password_manager/content/browser/credential_manager_dispatc
her.h" |
| 16 #include "components/password_manager/core/browser/password_manager.h" | 16 #include "components/password_manager/core/browser/password_manager.h" |
| 17 #include "components/password_manager/core/browser/password_manager_client.h" | 17 #include "components/password_manager/core/browser/password_manager_client.h" |
| 18 #include "components/password_manager/sync/browser/sync_credentials_filter.h" | 18 #include "components/password_manager/sync/browser/sync_credentials_filter.h" |
| 19 #include "components/prefs/pref_member.h" | 19 #include "components/prefs/pref_member.h" |
| 20 #include "content/public/browser/web_contents_observer.h" | 20 #include "content/public/browser/web_contents_observer.h" |
| 21 #include "content/public/browser/web_contents_user_data.h" | 21 #include "content/public/browser/web_contents_user_data.h" |
| 22 #include "ui/gfx/geometry/rect.h" | 22 #include "ui/gfx/geometry/rect.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 44 public content::WebContentsObserver, | 44 public content::WebContentsObserver, |
| 45 public content::WebContentsUserData<ChromePasswordManagerClient> { | 45 public content::WebContentsUserData<ChromePasswordManagerClient> { |
| 46 public: | 46 public: |
| 47 ~ChromePasswordManagerClient() override; | 47 ~ChromePasswordManagerClient() override; |
| 48 | 48 |
| 49 // PasswordManagerClient implementation. | 49 // PasswordManagerClient implementation. |
| 50 bool IsAutomaticPasswordSavingEnabled() const override; | 50 bool IsAutomaticPasswordSavingEnabled() const override; |
| 51 bool IsSavingAndFillingEnabledForCurrentPage() const override; | 51 bool IsSavingAndFillingEnabledForCurrentPage() const override; |
| 52 bool IsFillingEnabledForCurrentPage() const override; | 52 bool IsFillingEnabledForCurrentPage() const override; |
| 53 bool PromptUserToSaveOrUpdatePassword( | 53 bool PromptUserToSaveOrUpdatePassword( |
| 54 scoped_ptr<password_manager::PasswordFormManager> form_to_save, | 54 std::unique_ptr<password_manager::PasswordFormManager> form_to_save, |
| 55 password_manager::CredentialSourceType type, | 55 password_manager::CredentialSourceType type, |
| 56 bool update_password) override; | 56 bool update_password) override; |
| 57 bool PromptUserToChooseCredentials( | 57 bool PromptUserToChooseCredentials( |
| 58 ScopedVector<autofill::PasswordForm> local_forms, | 58 ScopedVector<autofill::PasswordForm> local_forms, |
| 59 ScopedVector<autofill::PasswordForm> federated_forms, | 59 ScopedVector<autofill::PasswordForm> federated_forms, |
| 60 const GURL& origin, | 60 const GURL& origin, |
| 61 const CredentialsCallback& callback) override; | 61 const CredentialsCallback& callback) override; |
| 62 void ForceSavePassword() override; | 62 void ForceSavePassword() override; |
| 63 void GeneratePassword() override; | 63 void GeneratePassword() override; |
| 64 void NotifyUserAutoSignin( | 64 void NotifyUserAutoSignin( |
| 65 ScopedVector<autofill::PasswordForm> local_forms, | 65 ScopedVector<autofill::PasswordForm> local_forms, |
| 66 const GURL& origin) override; | 66 const GURL& origin) override; |
| 67 void NotifyUserCouldBeAutoSignedIn( | 67 void NotifyUserCouldBeAutoSignedIn( |
| 68 scoped_ptr<autofill::PasswordForm> form) override; | 68 std::unique_ptr<autofill::PasswordForm> form) override; |
| 69 void NotifySuccessfulLoginWithExistingPassword( | 69 void NotifySuccessfulLoginWithExistingPassword( |
| 70 const autofill::PasswordForm& form) override; | 70 const autofill::PasswordForm& form) override; |
| 71 void AutomaticPasswordSave(scoped_ptr<password_manager::PasswordFormManager> | 71 void AutomaticPasswordSave( |
| 72 saved_form_manager) override; | 72 std::unique_ptr<password_manager::PasswordFormManager> saved_form_manager) |
| 73 override; |
| 73 void PasswordWasAutofilled( | 74 void PasswordWasAutofilled( |
| 74 const autofill::PasswordFormMap& best_matches, | 75 const autofill::PasswordFormMap& best_matches, |
| 75 const GURL& origin, | 76 const GURL& origin, |
| 76 const std::vector<scoped_ptr<autofill::PasswordForm>>* federated_matches) | 77 const std::vector<std::unique_ptr<autofill::PasswordForm>>* |
| 77 const override; | 78 federated_matches) const override; |
| 78 PrefService* GetPrefs() override; | 79 PrefService* GetPrefs() override; |
| 79 password_manager::PasswordStore* GetPasswordStore() const override; | 80 password_manager::PasswordStore* GetPasswordStore() const override; |
| 80 password_manager::PasswordSyncState GetPasswordSyncState() const override; | 81 password_manager::PasswordSyncState GetPasswordSyncState() const override; |
| 81 bool WasLastNavigationHTTPError() const override; | 82 bool WasLastNavigationHTTPError() const override; |
| 82 bool DidLastPageLoadEncounterSSLErrors() const override; | 83 bool DidLastPageLoadEncounterSSLErrors() const override; |
| 83 bool IsOffTheRecord() const override; | 84 bool IsOffTheRecord() const override; |
| 84 const password_manager::PasswordManager* GetPasswordManager() const override; | 85 const password_manager::PasswordManager* GetPasswordManager() const override; |
| 85 autofill::AutofillManager* GetAutofillManagerForMainFrame() override; | 86 autofill::AutofillManager* GetAutofillManagerForMainFrame() override; |
| 86 const GURL& GetMainFrameURL() const override; | 87 const GURL& GetMainFrameURL() const override; |
| 87 bool IsUpdatePasswordUIEnabled() const override; | 88 bool IsUpdatePasswordUIEnabled() const override; |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 // Controls the popup | 175 // Controls the popup |
| 175 base::WeakPtr< | 176 base::WeakPtr< |
| 176 autofill::PasswordGenerationPopupControllerImpl> popup_controller_; | 177 autofill::PasswordGenerationPopupControllerImpl> popup_controller_; |
| 177 | 178 |
| 178 // Set to false to disable password saving (will no longer ask if you | 179 // Set to false to disable password saving (will no longer ask if you |
| 179 // want to save passwords and also won't fill the passwords). | 180 // want to save passwords and also won't fill the passwords). |
| 180 BooleanPrefMember saving_and_filling_passwords_enabled_; | 181 BooleanPrefMember saving_and_filling_passwords_enabled_; |
| 181 | 182 |
| 182 const password_manager::SyncCredentialsFilter credentials_filter_; | 183 const password_manager::SyncCredentialsFilter credentials_filter_; |
| 183 | 184 |
| 184 scoped_ptr<password_manager::LogManager> log_manager_; | 185 std::unique_ptr<password_manager::LogManager> log_manager_; |
| 185 | 186 |
| 186 // Set during 'NotifyUserCouldBeAutoSignedIn' in order to store the | 187 // Set during 'NotifyUserCouldBeAutoSignedIn' in order to store the |
| 187 // form for potential use during 'NotifySuccessfulLoginWithExistingPassword'. | 188 // form for potential use during 'NotifySuccessfulLoginWithExistingPassword'. |
| 188 scoped_ptr<autofill::PasswordForm> possible_auto_sign_in_; | 189 std::unique_ptr<autofill::PasswordForm> possible_auto_sign_in_; |
| 189 | 190 |
| 190 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); | 191 DISALLOW_COPY_AND_ASSIGN(ChromePasswordManagerClient); |
| 191 }; | 192 }; |
| 192 | 193 |
| 193 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ | 194 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CHROME_PASSWORD_MANAGER_CLIENT_H_ |
| OLD | NEW |