OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/autofill/password_autofill_manager.h" | 5 #include "chrome/renderer/autofill/password_autofill_manager.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "chrome/common/autofill_messages.h" | 10 #include "chrome/common/autofill_messages.h" |
11 #include "chrome/renderer/autofill/form_autofill_util.h" | 11 #include "chrome/renderer/autofill/form_autofill_util.h" |
12 #include "content/public/renderer/render_view.h" | 12 #include "content/public/renderer/render_view.h" |
| 13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAutofillClient.h" |
13 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" | 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDocument.h" |
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" | 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebElement.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFormElement.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebFrame.h" |
17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
18 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" | 19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h" |
19 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 20 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
20 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" | 21 #include "third_party/WebKit/Source/WebKit/chromium/public/platform/WebVector.h" |
21 #include "ui/base/keycodes/keyboard_codes.h" | 22 #include "ui/base/keycodes/keyboard_codes.h" |
22 #include "webkit/forms/form_field.h" | 23 #include "webkit/forms/form_field.h" |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 } | 528 } |
528 | 529 |
529 | 530 |
530 if (suggestions.empty()) { | 531 if (suggestions.empty()) { |
531 webview->hidePopups(); | 532 webview->hidePopups(); |
532 return false; | 533 return false; |
533 } | 534 } |
534 | 535 |
535 std::vector<string16> labels(suggestions.size()); | 536 std::vector<string16> labels(suggestions.size()); |
536 std::vector<string16> icons(suggestions.size()); | 537 std::vector<string16> icons(suggestions.size()); |
537 std::vector<int> ids(suggestions.size(), 0); | 538 std::vector<int> ids(suggestions.size(), |
| 539 WebKit::WebAutofillClient::MenuItemIDPasswordEntry); |
538 webview->applyAutofillSuggestions( | 540 webview->applyAutofillSuggestions( |
539 user_input, suggestions, labels, icons, ids, -1); | 541 user_input, suggestions, labels, icons, ids); |
540 return true; | 542 return true; |
541 } | 543 } |
542 | 544 |
543 bool PasswordAutofillManager::FillUserNameAndPassword( | 545 bool PasswordAutofillManager::FillUserNameAndPassword( |
544 WebKit::WebInputElement* username_element, | 546 WebKit::WebInputElement* username_element, |
545 WebKit::WebInputElement* password_element, | 547 WebKit::WebInputElement* password_element, |
546 const webkit::forms::PasswordFormFillData& fill_data, | 548 const webkit::forms::PasswordFormFillData& fill_data, |
547 bool exact_username_match, | 549 bool exact_username_match, |
548 bool set_selection) { | 550 bool set_selection) { |
549 string16 current_username = username_element->value(); | 551 string16 current_username = username_element->value(); |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input); | 638 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input); |
637 if (iter == login_to_password_info_.end()) | 639 if (iter == login_to_password_info_.end()) |
638 return false; | 640 return false; |
639 | 641 |
640 *found_input = input; | 642 *found_input = input; |
641 *found_password = iter->second; | 643 *found_password = iter->second; |
642 return true; | 644 return true; |
643 } | 645 } |
644 | 646 |
645 } // namespace autofill | 647 } // namespace autofill |
OLD | NEW |