| 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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 const WebKit::WebInputElement& user_input) { | 415 const WebKit::WebInputElement& user_input) { |
| 416 std::vector<string16> suggestions; | 416 std::vector<string16> suggestions; |
| 417 GetSuggestions(fill_data, user_input.value(), &suggestions); | 417 GetSuggestions(fill_data, user_input.value(), &suggestions); |
| 418 if (suggestions.empty()) | 418 if (suggestions.empty()) |
| 419 return false; | 419 return false; |
| 420 | 420 |
| 421 WebKit::WebView* webview = user_input.document().frame()->view(); | 421 WebKit::WebView* webview = user_input.document().frame()->view(); |
| 422 if (!webview) | 422 if (!webview) |
| 423 return false; | 423 return false; |
| 424 | 424 |
| 425 webview->applyAutocompleteSuggestions(user_input, suggestions, -1); | 425 std::vector<string16> labels(suggestions.size()); |
| 426 std::vector<string16> icons(suggestions.size()); |
| 427 std::vector<int> ids(suggestions.size(), 0); |
| 428 webview->applyAutoFillSuggestions(user_input, suggestions, labels, icons, ids, |
| 429 -1); |
| 426 return true; | 430 return true; |
| 427 } | 431 } |
| 428 | 432 |
| 429 bool PasswordAutocompleteManager::FillUserNameAndPassword( | 433 bool PasswordAutocompleteManager::FillUserNameAndPassword( |
| 430 WebKit::WebInputElement* username_element, | 434 WebKit::WebInputElement* username_element, |
| 431 WebKit::WebInputElement* password_element, | 435 WebKit::WebInputElement* password_element, |
| 432 const webkit_glue::PasswordFormFillData& fill_data, | 436 const webkit_glue::PasswordFormFillData& fill_data, |
| 433 bool exact_username_match) { | 437 bool exact_username_match) { |
| 434 string16 current_username = username_element->value(); | 438 string16 current_username = username_element->value(); |
| 435 // username and password will contain the match found if any. | 439 // username and password will contain the match found if any. |
| (...skipping 28 matching lines...) Expand all Loading... |
| 464 SetElementAutofilled(username_element, true); | 468 SetElementAutofilled(username_element, true); |
| 465 if (IsElementEditable(*password_element)) | 469 if (IsElementEditable(*password_element)) |
| 466 password_element->setValue(password); | 470 password_element->setValue(password); |
| 467 SetElementAutofilled(password_element, true); | 471 SetElementAutofilled(password_element, true); |
| 468 return true; | 472 return true; |
| 469 } | 473 } |
| 470 | 474 |
| 471 int PasswordAutocompleteManager::GetRoutingID() const { | 475 int PasswordAutocompleteManager::GetRoutingID() const { |
| 472 return render_view_->routing_id(); | 476 return render_view_->routing_id(); |
| 473 } | 477 } |
| OLD | NEW |