OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 public: | 68 public: |
69 explicit ListPopulater(PasswordManagerHandler* page); | 69 explicit ListPopulater(PasswordManagerHandler* page); |
70 virtual ~ListPopulater(); | 70 virtual ~ListPopulater(); |
71 | 71 |
72 // Send a query to the password store to populate a list. | 72 // Send a query to the password store to populate a list. |
73 virtual void Populate() = 0; | 73 virtual void Populate() = 0; |
74 | 74 |
75 // Send the password store's reply back to the handler. | 75 // Send the password store's reply back to the handler. |
76 virtual void OnPasswordStoreRequestDone( | 76 virtual void OnPasswordStoreRequestDone( |
77 CancelableRequestProvider::Handle handle, | 77 CancelableRequestProvider::Handle handle, |
78 const std::vector<webkit_glue::PasswordForm*>& result) = 0; | 78 const std::vector<webkit::forms::PasswordForm*>& result) = 0; |
79 | 79 |
80 protected: | 80 protected: |
81 PasswordManagerHandler* page_; | 81 PasswordManagerHandler* page_; |
82 CancelableRequestProvider::Handle pending_login_query_; | 82 CancelableRequestProvider::Handle pending_login_query_; |
83 }; | 83 }; |
84 | 84 |
85 // A short class to mediate requests to the password store for passwordlist. | 85 // A short class to mediate requests to the password store for passwordlist. |
86 class PasswordListPopulater : public ListPopulater { | 86 class PasswordListPopulater : public ListPopulater { |
87 public: | 87 public: |
88 explicit PasswordListPopulater(PasswordManagerHandler* page); | 88 explicit PasswordListPopulater(PasswordManagerHandler* page); |
89 | 89 |
90 // Send a query to the password store to populate a password list. | 90 // Send a query to the password store to populate a password list. |
91 virtual void Populate() OVERRIDE; | 91 virtual void Populate() OVERRIDE; |
92 | 92 |
93 // Send the password store's reply back to the handler. | 93 // Send the password store's reply back to the handler. |
94 virtual void OnPasswordStoreRequestDone( | 94 virtual void OnPasswordStoreRequestDone( |
95 CancelableRequestProvider::Handle handle, | 95 CancelableRequestProvider::Handle handle, |
96 const std::vector<webkit_glue::PasswordForm*>& result) OVERRIDE; | 96 const std::vector<webkit::forms::PasswordForm*>& result) OVERRIDE; |
97 }; | 97 }; |
98 | 98 |
99 // A short class to mediate requests to the password store for exceptions. | 99 // A short class to mediate requests to the password store for exceptions. |
100 class PasswordExceptionListPopulater : public ListPopulater { | 100 class PasswordExceptionListPopulater : public ListPopulater { |
101 public: | 101 public: |
102 explicit PasswordExceptionListPopulater(PasswordManagerHandler* page); | 102 explicit PasswordExceptionListPopulater(PasswordManagerHandler* page); |
103 | 103 |
104 // Send a query to the password store to populate a passwordException list. | 104 // Send a query to the password store to populate a passwordException list. |
105 virtual void Populate() OVERRIDE; | 105 virtual void Populate() OVERRIDE; |
106 | 106 |
107 // Send the password store's reply back to the handler. | 107 // Send the password store's reply back to the handler. |
108 virtual void OnPasswordStoreRequestDone( | 108 virtual void OnPasswordStoreRequestDone( |
109 CancelableRequestProvider::Handle handle, | 109 CancelableRequestProvider::Handle handle, |
110 const std::vector<webkit_glue::PasswordForm*>& result) OVERRIDE; | 110 const std::vector<webkit::forms::PasswordForm*>& result) OVERRIDE; |
111 }; | 111 }; |
112 | 112 |
113 // Password store consumer for populating the password list and exceptions. | 113 // Password store consumer for populating the password list and exceptions. |
114 PasswordListPopulater populater_; | 114 PasswordListPopulater populater_; |
115 PasswordExceptionListPopulater exception_populater_; | 115 PasswordExceptionListPopulater exception_populater_; |
116 | 116 |
117 ScopedVector<webkit_glue::PasswordForm> password_list_; | 117 ScopedVector<webkit::forms::PasswordForm> password_list_; |
118 ScopedVector<webkit_glue::PasswordForm> password_exception_list_; | 118 ScopedVector<webkit::forms::PasswordForm> password_exception_list_; |
119 | 119 |
120 // User's pref | 120 // User's pref |
121 std::string languages_; | 121 std::string languages_; |
122 | 122 |
123 // Whether to show stored passwords or not. | 123 // Whether to show stored passwords or not. |
124 BooleanPrefMember show_passwords_; | 124 BooleanPrefMember show_passwords_; |
125 | 125 |
126 DISALLOW_COPY_AND_ASSIGN(PasswordManagerHandler); | 126 DISALLOW_COPY_AND_ASSIGN(PasswordManagerHandler); |
127 }; | 127 }; |
128 | 128 |
129 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ | 129 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_PASSWORD_MANAGER_HANDLER_H_ |
OLD | NEW |