OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_PASSWORD_MANAGER_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_H_ |
7 | 7 |
8 class PasswordFormManager; | 8 class PasswordFormManager; |
9 class PasswordManagerDriver; | |
9 class Profile; | 10 class Profile; |
10 | 11 |
11 namespace autofill { | |
12 struct PasswordFormFillData; | |
13 } // namespace autofill | |
14 | |
15 // An abstraction of operations in the external environment (WebContents) | 12 // An abstraction of operations in the external environment (WebContents) |
16 // that the PasswordManager depends on. This allows for more targeted | 13 // that the PasswordManager depends on. This allows for more targeted |
17 // unit testing. | 14 // unit testing. |
18 class PasswordManagerDelegate { | 15 class PasswordManagerDelegate { |
19 public: | 16 public: |
20 PasswordManagerDelegate() {} | 17 PasswordManagerDelegate() {} |
21 virtual ~PasswordManagerDelegate() {} | 18 virtual ~PasswordManagerDelegate() {} |
22 | 19 |
23 // Fill forms matching |form_data| in |web_contents|. By default, goes | |
24 // through the RenderViewHost to FillPasswordForm. Tests can override this | |
25 // to sever the dependency on the entire rendering stack. | |
26 virtual void FillPasswordForm( | |
27 const autofill::PasswordFormFillData& form_data) = 0; | |
28 | |
29 // A mechanism to show an infobar in the current tab at our request. | 20 // A mechanism to show an infobar in the current tab at our request. |
30 // The infobar may not show in some circumstances, such as when the one-click | 21 // The infobar may not show in some circumstances, such as when the one-click |
31 // sign in infobar is or will be shown. | 22 // sign in infobar is or will be shown. |
32 virtual void AddSavePasswordInfoBarIfPermitted( | 23 virtual void AddSavePasswordInfoBarIfPermitted( |
33 PasswordFormManager* form_to_save) = 0; | 24 PasswordFormManager* form_to_save) = 0; |
34 | 25 |
35 // Get the profile for which we are managing passwords. | 26 // Get the profile for which we are managing passwords. |
36 virtual Profile* GetProfile() = 0; | 27 virtual Profile* GetProfile() = 0; |
37 | 28 |
38 // If any SSL certificate errors were encountered as a result of the last | 29 // Returns the PasswordManagerDriver instance that is associated with this |
Patrick Dubroy
2014/02/03 13:15:08
Nit: If you remove "that is" , you can bring this
blundell
2014/02/03 14:37:59
Done.
| |
39 // page load. | 30 // instance. |
40 virtual bool DidLastPageLoadEncounterSSLErrors() = 0; | 31 virtual PasswordManagerDriver* GetDriver() = 0; |
41 | 32 |
42 private: | 33 private: |
43 DISALLOW_COPY_AND_ASSIGN(PasswordManagerDelegate); | 34 DISALLOW_COPY_AND_ASSIGN(PasswordManagerDelegate); |
44 }; | 35 }; |
45 | 36 |
46 | 37 |
47 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_H_ | 38 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_H_ |
OLD | NEW |