OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This file provides the implementaiton of the password manager's autocomplete | 5 // This file provides the implementaiton of the password manager's autocomplete |
6 // component. | 6 // component. |
7 | 7 |
8 #include "webkit/glue/webpasswordautocompletelistener_impl.h" | 8 #include "webkit/glue/webpasswordautocompletelistener_impl.h" |
9 | 9 |
10 #include <vector> | 10 #include <vector> |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 WebPasswordAutocompleteListenerImpl::WebPasswordAutocompleteListenerImpl( | 77 WebPasswordAutocompleteListenerImpl::WebPasswordAutocompleteListenerImpl( |
78 WebInputElementDelegate* username_delegate, | 78 WebInputElementDelegate* username_delegate, |
79 WebInputElementDelegate* password_delegate, | 79 WebInputElementDelegate* password_delegate, |
80 const PasswordFormFillData& data) | 80 const PasswordFormFillData& data) |
81 : password_delegate_(password_delegate), | 81 : password_delegate_(password_delegate), |
82 username_delegate_(username_delegate), | 82 username_delegate_(username_delegate), |
83 data_(data) { | 83 data_(data) { |
84 } | 84 } |
85 | 85 |
| 86 WebPasswordAutocompleteListenerImpl::~WebPasswordAutocompleteListenerImpl() { |
| 87 } |
| 88 |
86 void WebPasswordAutocompleteListenerImpl::didBlurInputElement( | 89 void WebPasswordAutocompleteListenerImpl::didBlurInputElement( |
87 const WebString& user_input) { | 90 const WebString& user_input) { |
88 // If this listener exists, its because the password manager had more than | 91 // If this listener exists, its because the password manager had more than |
89 // one match for the password form, which implies it had at least one | 92 // one match for the password form, which implies it had at least one |
90 // [preferred] username/password pair. | 93 // [preferred] username/password pair. |
91 // DCHECK(data_.basic_data.values.size() == 2); | 94 // DCHECK(data_.basic_data.values.size() == 2); |
92 | 95 |
93 if (!password_delegate_->IsEditable()) | 96 if (!password_delegate_->IsEditable()) |
94 return; | 97 return; |
95 | 98 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 for (PasswordFormFillData::LoginCollection::iterator it = | 194 for (PasswordFormFillData::LoginCollection::iterator it = |
192 data_.additional_logins.begin(); | 195 data_.additional_logins.begin(); |
193 it != data_.additional_logins.end(); | 196 it != data_.additional_logins.end(); |
194 ++it) { | 197 ++it) { |
195 if (StartsWith(it->first, input, false)) | 198 if (StartsWith(it->first, input, false)) |
196 suggestions->push_back(it->first); | 199 suggestions->push_back(it->first); |
197 } | 200 } |
198 } | 201 } |
199 | 202 |
200 } // namespace webkit_glue | 203 } // namespace webkit_glue |
OLD | NEW |