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.
5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_CONTENT_PASSWORD_MANAGER_DRIVER_H_
6 #define CHROME_BROWSER_PASSWORD_MANAGER_CONTENT_PASSWORD_MANAGER_DRIVER_H_
8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h"
10 #include "chrome/browser/password_manager/password_generation_manager.h"
11 #include "chrome/browser/password_manager/password_manager.h"
12 #include "chrome/browser/password_manager/password_manager_driver.h"
13 #include "content/public/browser/web_contents_observer.h"
16 class AutofillManager
;
24 class ContentPasswordManagerDriver
: public PasswordManagerDriver
,
25 public content::WebContentsObserver
{
27 explicit ContentPasswordManagerDriver(content::WebContents
* web_contents
,
28 PasswordManagerClient
* client
);
29 virtual ~ContentPasswordManagerDriver();
31 // PasswordManagerDriver implementation.
32 virtual void FillPasswordForm(const autofill::PasswordFormFillData
& form_data
)
34 virtual bool DidLastPageLoadEncounterSSLErrors() OVERRIDE
;
35 virtual bool IsOffTheRecord() OVERRIDE
;
36 virtual PasswordGenerationManager
* GetPasswordGenerationManager() OVERRIDE
;
37 virtual PasswordManager
* GetPasswordManager() OVERRIDE
;
38 virtual autofill::AutofillManager
* GetAutofillManager() OVERRIDE
;
39 virtual void AllowPasswordGenerationForForm(autofill::PasswordForm
* form
)
42 // content::WebContentsObserver overrides.
43 virtual bool OnMessageReceived(const IPC::Message
& message
) OVERRIDE
;
44 virtual void DidNavigateMainFrame(
45 const content::LoadCommittedDetails
& details
,
46 const content::FrameNavigateParams
& params
) OVERRIDE
;
49 // Must outlive this instance.
50 PasswordManagerClient
* client_
;
52 PasswordManager password_manager_
;
53 PasswordGenerationManager password_generation_manager_
;
55 DISALLOW_COPY_AND_ASSIGN(ContentPasswordManagerDriver
);
58 #endif // CHROME_BROWSER_PASSWORD_MANAGER_CONTENT_PASSWORD_MANAGER_DRIVER_H_