| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/autofill/content/renderer/autofill_agent.h" | 5 #include "components/autofill/content/renderer/autofill_agent.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 | 409 |
| 410 if (event.windowsKeyCode == ui::VKEY_DOWN || | 410 if (event.windowsKeyCode == ui::VKEY_DOWN || |
| 411 event.windowsKeyCode == ui::VKEY_UP) | 411 event.windowsKeyCode == ui::VKEY_UP) |
| 412 ShowSuggestions(element, true, true, true, false); | 412 ShowSuggestions(element, true, true, true, false); |
| 413 } | 413 } |
| 414 | 414 |
| 415 void AutofillAgent::openTextDataListChooser(const WebInputElement& element) { | 415 void AutofillAgent::openTextDataListChooser(const WebInputElement& element) { |
| 416 ShowSuggestions(element, true, false, false, true); | 416 ShowSuggestions(element, true, false, false, true); |
| 417 } | 417 } |
| 418 | 418 |
| 419 void AutofillAgent::firstUserGestureObserved() { |
| 420 password_autofill_agent_->FirstUserGestureObserved(); |
| 421 } |
| 422 |
| 419 void AutofillAgent::AcceptDataListSuggestion( | 423 void AutofillAgent::AcceptDataListSuggestion( |
| 420 const base::string16& suggested_value) { | 424 const base::string16& suggested_value) { |
| 421 WebInputElement* input_element = toWebInputElement(&element_); | 425 WebInputElement* input_element = toWebInputElement(&element_); |
| 422 DCHECK(input_element); | 426 DCHECK(input_element); |
| 423 base::string16 new_value = suggested_value; | 427 base::string16 new_value = suggested_value; |
| 424 // If this element takes multiple values then replace the last part with | 428 // If this element takes multiple values then replace the last part with |
| 425 // the suggestion. | 429 // the suggestion. |
| 426 if (input_element->isMultiple() && | 430 if (input_element->isMultiple() && |
| 427 input_element->formControlType() == WebString::fromUTF8("email")) { | 431 input_element->formControlType() == WebString::fromUTF8("email")) { |
| 428 std::vector<base::string16> parts; | 432 std::vector<base::string16> parts; |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 // Only monitors dynamic forms created in the top frame. Dynamic forms | 701 // Only monitors dynamic forms created in the top frame. Dynamic forms |
| 698 // inserted in iframes are not captured yet. | 702 // inserted in iframes are not captured yet. |
| 699 if (frame && !frame->parent()) { | 703 if (frame && !frame->parent()) { |
| 700 password_autofill_agent_->OnDynamicFormsSeen(frame); | 704 password_autofill_agent_->OnDynamicFormsSeen(frame); |
| 701 return; | 705 return; |
| 702 } | 706 } |
| 703 } | 707 } |
| 704 } | 708 } |
| 705 | 709 |
| 706 } // namespace autofill | 710 } // namespace autofill |
| OLD | NEW |