Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(454)

Side by Side Diff: chrome/browser/password_manager/password_manager_delegate_impl.h

Issue 151413008: Move ownership of Password(Generation)Manager to ContentPasswordDriver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Handle WebContents having no PasswordManagerDelegateImpl attached Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_IMPL_H_ 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_IMPL_H_
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_IMPL_H_ 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_IMPL_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "chrome/browser/password_manager/content_password_manager_driver.h" 10 #include "chrome/browser/password_manager/content_password_manager_driver.h"
11 #include "chrome/browser/password_manager/password_manager_delegate.h" 11 #include "chrome/browser/password_manager/password_manager_delegate.h"
12 #include "content/public/browser/web_contents_user_data.h" 12 #include "content/public/browser/web_contents_user_data.h"
13 13
14 class PasswordGenerationManager;
15 class PasswordManager;
16
14 namespace content { 17 namespace content {
15 class WebContents; 18 class WebContents;
16 } 19 }
17 20
18 class PasswordManagerDelegateImpl 21 class PasswordManagerDelegateImpl
19 : public PasswordManagerDelegate, 22 : public PasswordManagerDelegate,
20 public content::WebContentsUserData<PasswordManagerDelegateImpl> { 23 public content::WebContentsUserData<PasswordManagerDelegateImpl> {
21 public: 24 public:
22 virtual ~PasswordManagerDelegateImpl(); 25 virtual ~PasswordManagerDelegateImpl();
23 26
24 // PasswordManagerDelegate implementation. 27 // PasswordManagerDelegate implementation.
25 virtual void AddSavePasswordInfoBarIfPermitted( 28 virtual void AddSavePasswordInfoBarIfPermitted(
26 PasswordFormManager* form_to_save) OVERRIDE; 29 PasswordFormManager* form_to_save) OVERRIDE;
27 virtual Profile* GetProfile() OVERRIDE; 30 virtual Profile* GetProfile() OVERRIDE;
28 virtual PasswordManagerDriver* GetDriver() OVERRIDE; 31 virtual PasswordManagerDriver* GetDriver() OVERRIDE;
29 32
33 // Convenience method to allow //chrome code easy access to a PasswordManager
34 // from a WebContents instance.
35 static PasswordManager* GetManagerFromWebContents(
36 content::WebContents* contents);
37
38 // Convenience method to allow //chrome code easy access to a
39 // PasswordGenerationManager
40 // from a WebContents instance.
41 static PasswordGenerationManager* GetGenerationManagerFromWebContents(
42 content::WebContents* contents);
43
30 private: 44 private:
31 explicit PasswordManagerDelegateImpl(content::WebContents* web_contents); 45 explicit PasswordManagerDelegateImpl(content::WebContents* web_contents);
32 friend class content::WebContentsUserData<PasswordManagerDelegateImpl>; 46 friend class content::WebContentsUserData<PasswordManagerDelegateImpl>;
33 47
34 content::WebContents* web_contents_; 48 content::WebContents* web_contents_;
35 ContentPasswordManagerDriver driver_; 49 ContentPasswordManagerDriver driver_;
36 50
37 DISALLOW_COPY_AND_ASSIGN(PasswordManagerDelegateImpl); 51 DISALLOW_COPY_AND_ASSIGN(PasswordManagerDelegateImpl);
38 }; 52 };
39 53
40 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_IMPL_H_ 54 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_MANAGER_DELEGATE_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/browser/password_manager/password_manager.cc ('k') | chrome/browser/password_manager/password_manager_delegate_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698