OLD | NEW |
---|---|
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
csilv
2011/01/21 02:18:21
Bump copyright date
James Hawkins
2011/01/21 02:21:50
Done.
| |
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_DOM_UI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_DOM_UI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ |
6 #define CHROME_BROWSER_DOM_UI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ | 6 #define CHROME_BROWSER_DOM_UI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "chrome/browser/dom_ui/options/options_ui.h" | 11 #include "chrome/browser/dom_ui/options/options_ui.h" |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
49 void ShowSelectedPassword(const ListValue* args); | 49 void ShowSelectedPassword(const ListValue* args); |
50 | 50 |
51 // Sets the password and exception list contents to the given data. | 51 // Sets the password and exception list contents to the given data. |
52 // We take ownership of the PasswordForms in the vector. | 52 // We take ownership of the PasswordForms in the vector. |
53 void SetPasswordList(); | 53 void SetPasswordList(); |
54 void SetPasswordExceptionList(); | 54 void SetPasswordExceptionList(); |
55 | 55 |
56 // A short class to mediate requests to the password store. | 56 // A short class to mediate requests to the password store. |
57 class ListPopulater : public PasswordStoreConsumer { | 57 class ListPopulater : public PasswordStoreConsumer { |
58 public: | 58 public: |
59 explicit ListPopulater(PasswordManagerHandler* page) | 59 explicit ListPopulater(PasswordManagerHandler* page); |
60 : page_(page), | 60 virtual ~ListPopulater(); |
61 pending_login_query_(0) { | |
62 } | |
63 | 61 |
64 // Send a query to the password store to populate a list. | 62 // Send a query to the password store to populate a list. |
65 virtual void Populate() = 0; | 63 virtual void Populate() = 0; |
66 | 64 |
67 // Send the password store's reply back to the handler. | 65 // Send the password store's reply back to the handler. |
68 virtual void OnPasswordStoreRequestDone( | 66 virtual void OnPasswordStoreRequestDone( |
69 int handle, const std::vector<webkit_glue::PasswordForm*>& result) = 0; | 67 int handle, const std::vector<webkit_glue::PasswordForm*>& result) = 0; |
70 | 68 |
71 protected: | 69 protected: |
72 PasswordManagerHandler* page_; | 70 PasswordManagerHandler* page_; |
73 int pending_login_query_; | 71 int pending_login_query_; |
74 }; | 72 }; |
75 | 73 |
76 // A short class to mediate requests to the password store for passwordlist. | 74 // A short class to mediate requests to the password store for passwordlist. |
77 class PasswordListPopulater : public ListPopulater { | 75 class PasswordListPopulater : public ListPopulater { |
78 public: | 76 public: |
79 explicit PasswordListPopulater(PasswordManagerHandler* page) | 77 explicit PasswordListPopulater(PasswordManagerHandler* page); |
80 : ListPopulater(page) { | |
81 } | |
82 | 78 |
83 // Send a query to the password store to populate a password list. | 79 // Send a query to the password store to populate a password list. |
84 virtual void Populate(); | 80 virtual void Populate(); |
85 | 81 |
86 // Send the password store's reply back to the handler. | 82 // Send the password store's reply back to the handler. |
87 virtual void OnPasswordStoreRequestDone( | 83 virtual void OnPasswordStoreRequestDone( |
88 int handle, const std::vector<webkit_glue::PasswordForm*>& result); | 84 int handle, const std::vector<webkit_glue::PasswordForm*>& result); |
89 }; | 85 }; |
90 | 86 |
91 // A short class to mediate requests to the password store for exceptions. | 87 // A short class to mediate requests to the password store for exceptions. |
92 class PasswordExceptionListPopulater : public ListPopulater { | 88 class PasswordExceptionListPopulater : public ListPopulater { |
93 public: | 89 public: |
94 explicit PasswordExceptionListPopulater( | 90 explicit PasswordExceptionListPopulater(PasswordManagerHandler* page); |
95 PasswordManagerHandler* page) : ListPopulater(page) { | |
96 } | |
97 | 91 |
98 // Send a query to the password store to populate a passwordException list. | 92 // Send a query to the password store to populate a passwordException list. |
99 virtual void Populate(); | 93 virtual void Populate(); |
100 | 94 |
101 // Send the password store's reply back to the handler. | 95 // Send the password store's reply back to the handler. |
102 virtual void OnPasswordStoreRequestDone( | 96 virtual void OnPasswordStoreRequestDone( |
103 int handle, const std::vector<webkit_glue::PasswordForm*>& result); | 97 int handle, const std::vector<webkit_glue::PasswordForm*>& result); |
104 }; | 98 }; |
105 | 99 |
106 // Password store consumer for populating the password list and exceptions. | 100 // Password store consumer for populating the password list and exceptions. |
107 PasswordListPopulater populater_; | 101 PasswordListPopulater populater_; |
108 PasswordExceptionListPopulater exception_populater_; | 102 PasswordExceptionListPopulater exception_populater_; |
109 | 103 |
110 std::vector<webkit_glue::PasswordForm*> password_list_; | 104 std::vector<webkit_glue::PasswordForm*> password_list_; |
111 std::vector<webkit_glue::PasswordForm*> password_exception_list_; | 105 std::vector<webkit_glue::PasswordForm*> password_exception_list_; |
112 | 106 |
113 // User's pref | 107 // User's pref |
114 std::string languages_; | 108 std::string languages_; |
115 | 109 |
116 DISALLOW_COPY_AND_ASSIGN(PasswordManagerHandler); | 110 DISALLOW_COPY_AND_ASSIGN(PasswordManagerHandler); |
117 }; | 111 }; |
118 | 112 |
119 #endif // CHROME_BROWSER_DOM_UI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ | 113 #endif // CHROME_BROWSER_DOM_UI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ |
OLD | NEW |