OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_GENERATION_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_GENERATION_MANAGER_H_ |
6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_GENERATION_MANAGER_H_ | 6 #define CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_GENERATION_MANAGER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 // When enabled we will send a message enabling this feature in the renderer, | 39 // When enabled we will send a message enabling this feature in the renderer, |
40 // which will show an icon next to password fields which we think are associated | 40 // which will show an icon next to password fields which we think are associated |
41 // with account creation. This class also manages the popup which is created | 41 // with account creation. This class also manages the popup which is created |
42 // if the user chooses to generate a password. | 42 // if the user chooses to generate a password. |
43 class PasswordGenerationManager | 43 class PasswordGenerationManager |
44 : public ProfileSyncServiceObserver, | 44 : public ProfileSyncServiceObserver, |
45 public content::WebContentsObserver, | 45 public content::WebContentsObserver, |
46 public content::WebContentsUserData<PasswordGenerationManager> { | 46 public content::WebContentsUserData<PasswordGenerationManager> { |
47 public: | 47 public: |
48 static void CreateForWebContents(content::WebContents* contents); | 48 static void CreateForWebContents(content::WebContents* contents); |
49 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry); | 49 static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry); |
50 virtual ~PasswordGenerationManager(); | 50 virtual ~PasswordGenerationManager(); |
51 | 51 |
52 protected: | 52 protected: |
53 explicit PasswordGenerationManager(content::WebContents* contents); | 53 explicit PasswordGenerationManager(content::WebContents* contents); |
54 | 54 |
55 private: | 55 private: |
56 friend class content::WebContentsUserData<PasswordGenerationManager>; | 56 friend class content::WebContentsUserData<PasswordGenerationManager>; |
57 friend class PasswordGenerationManagerTest; | 57 friend class PasswordGenerationManagerTest; |
58 | 58 |
59 // WebContentsObserver: | 59 // WebContentsObserver: |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // For vending a weak_ptr for |registrar_|. | 97 // For vending a weak_ptr for |registrar_|. |
98 base::WeakPtrFactory<PasswordGenerationManager> weak_factory_; | 98 base::WeakPtrFactory<PasswordGenerationManager> weak_factory_; |
99 | 99 |
100 // Controls how passwords are generated. | 100 // Controls how passwords are generated. |
101 scoped_ptr<autofill::PasswordGenerator> password_generator_; | 101 scoped_ptr<autofill::PasswordGenerator> password_generator_; |
102 | 102 |
103 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManager); | 103 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManager); |
104 }; | 104 }; |
105 | 105 |
106 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_GENERATION_MANAGER_H_ | 106 #endif // CHROME_BROWSER_PASSWORD_MANAGER_PASSWORD_GENERATION_MANAGER_H_ |
OLD | NEW |