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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_H_
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_H_
8 class PasswordFormManager
;
12 struct PasswordFormFillData
;
13 } // namespace autofill
15 // An abstraction of operations in the external environment (WebContents)
16 // that the PasswordManager depends on. This allows for more targeted
18 class PasswordManagerDelegate
{
20 PasswordManagerDelegate() {}
21 virtual ~PasswordManagerDelegate() {}
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;
29 // 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
31 // sign in infobar is or will be shown.
32 virtual void AddSavePasswordInfoBarIfPermitted(
33 PasswordFormManager
* form_to_save
) = 0;
35 // Get the profile for which we are managing passwords.
36 virtual Profile
* GetProfile() = 0;
38 // If any SSL certificate errors were encountered as a result of the last
40 virtual bool DidLastPageLoadEncounterSSLErrors() = 0;
43 DISALLOW_COPY_AND_ASSIGN(PasswordManagerDelegate
);
47 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_H_