| 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_MANAGER_DRIVER_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_DRIVER_H_ |
| 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_DRIVER_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_DRIVER_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 namespace autofill { | 10 namespace autofill { |
| 11 class AutofillManager; | 11 class AutofillManager; |
| 12 struct FormData; | 12 struct FormData; |
| 13 struct PasswordForm; | 13 struct PasswordForm; |
| 14 struct PasswordFormFillData; | 14 struct PasswordFormFillData; |
| 15 } // namespace autofill | 15 } // namespace autofill |
| 16 | 16 |
| 17 namespace password_manager { | 17 namespace password_manager { |
| 18 | 18 |
| 19 class PasswordAutofillManager; |
| 19 class PasswordGenerationManager; | 20 class PasswordGenerationManager; |
| 20 class PasswordManager; | 21 class PasswordManager; |
| 21 | 22 |
| 22 // Interface that allows PasswordManager core code to interact with its driver | 23 // Interface that allows PasswordManager core code to interact with its driver |
| 23 // (i.e., obtain information from it and give information to it). | 24 // (i.e., obtain information from it and give information to it). |
| 24 class PasswordManagerDriver { | 25 class PasswordManagerDriver { |
| 25 public: | 26 public: |
| 26 PasswordManagerDriver() {} | 27 PasswordManagerDriver() {} |
| 27 virtual ~PasswordManagerDriver() {} | 28 virtual ~PasswordManagerDriver() {} |
| 28 | 29 |
| 29 // Fills forms matching |form_data|. | 30 // Fills forms matching |form_data|. |
| 30 virtual void FillPasswordForm( | 31 virtual void FillPasswordForm( |
| 31 const autofill::PasswordFormFillData& form_data) = 0; | 32 const autofill::PasswordFormFillData& form_data) = 0; |
| 32 | 33 |
| 33 // Returns whether any SSL certificate errors were encountered as a result of | 34 // Returns whether any SSL certificate errors were encountered as a result of |
| 34 // the last page load. | 35 // the last page load. |
| 35 virtual bool DidLastPageLoadEncounterSSLErrors() = 0; | 36 virtual bool DidLastPageLoadEncounterSSLErrors() = 0; |
| 36 | 37 |
| 37 // If this browsing session should not be persisted. | 38 // If this browsing session should not be persisted. |
| 38 virtual bool IsOffTheRecord() = 0; | 39 virtual bool IsOffTheRecord() = 0; |
| 39 | 40 |
| 40 // Returns the PasswordGenerationManager associated with this instance. | |
| 41 virtual PasswordGenerationManager* GetPasswordGenerationManager() = 0; | |
| 42 | |
| 43 // Returns the PasswordManager associated with this instance. | |
| 44 virtual PasswordManager* GetPasswordManager() = 0; | |
| 45 | |
| 46 // Returns the AutofillManager associated with this instance. | |
| 47 virtual autofill::AutofillManager* GetAutofillManager() = 0; | |
| 48 | |
| 49 // Informs the driver that |form| can be used for password generation. | 41 // Informs the driver that |form| can be used for password generation. |
| 50 virtual void AllowPasswordGenerationForForm(autofill::PasswordForm* form) = 0; | 42 virtual void AllowPasswordGenerationForForm(autofill::PasswordForm* form) = 0; |
| 51 | 43 |
| 52 // Notifies the driver that account creation |forms| were found. | 44 // Notifies the driver that account creation |forms| were found. |
| 53 virtual void AccountCreationFormsFound( | 45 virtual void AccountCreationFormsFound( |
| 54 const std::vector<autofill::FormData>& forms) = 0; | 46 const std::vector<autofill::FormData>& forms) = 0; |
| 55 | 47 |
| 48 // Tells the driver to accept the password autofill suggestion for |username| |
| 49 // and fill the password with |password|. |
| 50 virtual void AcceptPasswordAutofillSuggestion( |
| 51 const base::string16& username, |
| 52 const base::string16& password) = 0; |
| 53 |
| 54 // Returns the PasswordGenerationManager associated with this instance. |
| 55 virtual PasswordGenerationManager* GetPasswordGenerationManager() = 0; |
| 56 |
| 57 // Returns the PasswordManager associated with this instance. |
| 58 virtual PasswordManager* GetPasswordManager() = 0; |
| 59 |
| 60 // Returns the PasswordAutofillManager associated with this instance. |
| 61 virtual PasswordAutofillManager* GetPasswordAutofillManager() = 0; |
| 62 |
| 63 // Returns the AutofillManager associated with this instance. |
| 64 virtual autofill::AutofillManager* GetAutofillManager() = 0; |
| 65 |
| 56 private: | 66 private: |
| 57 DISALLOW_COPY_AND_ASSIGN(PasswordManagerDriver); | 67 DISALLOW_COPY_AND_ASSIGN(PasswordManagerDriver); |
| 58 }; | 68 }; |
| 59 | 69 |
| 60 } // namespace password_manager | 70 } // namespace password_manager |
| 61 | 71 |
| 62 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_DRIVER_H_ | 72 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_MANAGER_DRIVER_H_ |
| OLD | NEW |