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