OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_GENERATION_MANAGER_H_ | 5 #ifndef COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_GENERATION_MANAGER_H_ |
6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_GENERATION_MANAGER_H_ | 6 #define COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_GENERATION_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 // NOTE: At the moment, the creation of the renderer PasswordGenerationManager | 26 // NOTE: At the moment, the creation of the renderer PasswordGenerationManager |
27 // is controlled by a switch (--enable-password-generation) so this feature will | 27 // is controlled by a switch (--enable-password-generation) so this feature will |
28 // not be enabled regardless of the above criteria without the switch being | 28 // not be enabled regardless of the above criteria without the switch being |
29 // present. | 29 // present. |
30 // | 30 // |
31 // This class is used to determine what forms we should offer to generate | 31 // This class is used to determine what forms we should offer to generate |
32 // passwords for and manages the popup which is created if the user chooses to | 32 // passwords for and manages the popup which is created if the user chooses to |
33 // generate a password. | 33 // generate a password. |
34 class PasswordGenerationManager { | 34 class PasswordGenerationManager { |
35 public: | 35 public: |
36 explicit PasswordGenerationManager(PasswordManagerClient* client); | 36 PasswordGenerationManager(PasswordManagerClient* client, |
| 37 PasswordManagerDriver* driver); |
37 virtual ~PasswordGenerationManager(); | 38 virtual ~PasswordGenerationManager(); |
38 | 39 |
39 // Detect account creation forms from forms with autofill type annotated. | 40 // Detect account creation forms from forms with autofill type annotated. |
40 // Will send a message to the renderer if we find a correctly annotated form | 41 // Will send a message to the renderer if we find a correctly annotated form |
41 // and the feature is enabled. | 42 // and the feature is enabled. |
42 void DetectAccountCreationForms( | 43 void DetectAccountCreationForms( |
43 const std::vector<autofill::FormStructure*>& forms); | 44 const std::vector<autofill::FormStructure*>& forms); |
44 | 45 |
45 private: | 46 private: |
46 friend class PasswordGenerationManagerTest; | 47 friend class PasswordGenerationManagerTest; |
47 | 48 |
48 // Determines current state of password generation | 49 // Determines current state of password generation |
49 bool IsGenerationEnabled() const; | 50 bool IsGenerationEnabled() const; |
50 | 51 |
51 // The PasswordManagerClient instance associated with this instance. Must | 52 // The PasswordManagerClient instance associated with this instance. Must |
52 // outlive this instance. | 53 // outlive this instance. |
53 PasswordManagerClient* client_; | 54 PasswordManagerClient* client_; |
54 | 55 |
55 // The PasswordManagerDriver instance associated with this instance. Must | 56 // The PasswordManagerDriver instance associated with this instance. Must |
56 // outlive this instance. | 57 // outlive this instance. |
57 PasswordManagerDriver* driver_; | 58 PasswordManagerDriver* driver_; |
58 | 59 |
59 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManager); | 60 DISALLOW_COPY_AND_ASSIGN(PasswordGenerationManager); |
60 }; | 61 }; |
61 | 62 |
62 } // namespace password_manager | 63 } // namespace password_manager |
63 | 64 |
64 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_GENERATION_MANAGER_
H_ | 65 #endif // COMPONENTS_PASSWORD_MANAGER_CORE_BROWSER_PASSWORD_GENERATION_MANAGER_
H_ |
OLD | NEW |