Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / password_manager / password_manager_driver.h
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DRIVER_H_
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DRIVER_H_
7
8 class PasswordGenerationManager;
9 class PasswordManager;
10
11 namespace autofill {
12 class AutofillManager;
13 struct PasswordForm;
14 struct PasswordFormFillData;
15 }  // namespace autofill
16
17 // Interface that allows PasswordManager core code to interact with its driver
18 // (i.e., obtain information from it and give information to it).
19 class PasswordManagerDriver {
20  public:
21   PasswordManagerDriver() {}
22   virtual ~PasswordManagerDriver() {}
23
24   // Fills forms matching |form_data|.
25   virtual void FillPasswordForm(
26       const autofill::PasswordFormFillData& form_data) = 0;
27
28   // Returns whether any SSL certificate errors were encountered as a result of
29   // the last page load.
30   virtual bool DidLastPageLoadEncounterSSLErrors() = 0;
31
32   // If this browsing session should not be persisted.
33   virtual bool IsOffTheRecord() = 0;
34
35   // Returns the PasswordGenerationManager associated with this instance.
36   virtual PasswordGenerationManager* GetPasswordGenerationManager() = 0;
37
38   // Returns the PasswordManager associated with this instance.
39   virtual PasswordManager* GetPasswordManager() = 0;
40
41   // Returns the AutofillManager associated with this instance.
42   virtual autofill::AutofillManager* GetAutofillManager() = 0;
43
44   // Informs the driver that |form| can be used for password generation.
45   virtual void AllowPasswordGenerationForForm(autofill::PasswordForm* form) = 0;
46
47  private:
48   DISALLOW_COPY_AND_ASSIGN(PasswordManagerDriver);
49 };
50
51 #endif  // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DRIVER_H_