| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "chrome/renderer/password_autocomplete_manager.h" | 5 #include "chrome/renderer/password_autocomplete_manager.h" |
| 6 | 6 |
| 7 #include "app/keyboard_codes.h" | 7 #include "app/keyboard_codes.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
| 10 #include "chrome/common/render_messages.h" | 10 #include "chrome/common/render_messages.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 element->setAutofilled(autofilled); | 154 element->setAutofilled(autofilled); |
| 155 // Notify any changeEvent listeners. | 155 // Notify any changeEvent listeners. |
| 156 element->dispatchFormControlChangeEvent(); | 156 element->dispatchFormControlChangeEvent(); |
| 157 } | 157 } |
| 158 | 158 |
| 159 bool DoUsernamesMatch(const string16& username1, | 159 bool DoUsernamesMatch(const string16& username1, |
| 160 const string16& username2, | 160 const string16& username2, |
| 161 bool exact_match) { | 161 bool exact_match) { |
| 162 if (exact_match) | 162 if (exact_match) |
| 163 return username1 == username2; | 163 return username1 == username2; |
| 164 return StartsWith(username1, username2, false); | 164 return StartsWith(username1, username2, true); |
| 165 } | 165 } |
| 166 | 166 |
| 167 } // namespace | 167 } // namespace |
| 168 | 168 |
| 169 //////////////////////////////////////////////////////////////////////////////// | 169 //////////////////////////////////////////////////////////////////////////////// |
| 170 // PasswordAutocompleteManager, public: | 170 // PasswordAutocompleteManager, public: |
| 171 | 171 |
| 172 PasswordAutocompleteManager::PasswordAutocompleteManager( | 172 PasswordAutocompleteManager::PasswordAutocompleteManager( |
| 173 RenderView* render_view) | 173 RenderView* render_view) |
| 174 : render_view_(render_view), | 174 : render_view_(render_view), |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 SetElementAutofilled(username_element, true); | 464 SetElementAutofilled(username_element, true); |
| 465 if (IsElementEditable(*password_element)) | 465 if (IsElementEditable(*password_element)) |
| 466 password_element->setValue(password); | 466 password_element->setValue(password); |
| 467 SetElementAutofilled(password_element, true); | 467 SetElementAutofilled(password_element, true); |
| 468 return true; | 468 return true; |
| 469 } | 469 } |
| 470 | 470 |
| 471 int PasswordAutocompleteManager::GetRoutingID() const { | 471 int PasswordAutocompleteManager::GetRoutingID() const { |
| 472 return render_view_->routing_id(); | 472 return render_view_->routing_id(); |
| 473 } | 473 } |
| OLD | NEW |