OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007 Apple, Inc. All rights reserved. |
3 * Copyright (C) 2012 Google, Inc. All rights reserved. | 3 * Copyright (C) 2012 Google, Inc. All rights reserved. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 638 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
649 { | 649 { |
650 // We handle IME within chrome. | 650 // We handle IME within chrome. |
651 } | 651 } |
652 | 652 |
653 void EditorClientImpl::textFieldDidBeginEditing(Element* element) | 653 void EditorClientImpl::textFieldDidBeginEditing(Element* element) |
654 { | 654 { |
655 } | 655 } |
656 | 656 |
657 void EditorClientImpl::textFieldDidEndEditing(Element* element) | 657 void EditorClientImpl::textFieldDidEndEditing(Element* element) |
658 { | 658 { |
659 HTMLInputElement* inputElement = element->toInputElement(); | 659 Handle<HTMLInputElement> inputElement = element->toInputElement(); |
660 if (m_webView->autofillClient() && inputElement) | 660 if (m_webView->autofillClient() && inputElement) |
661 m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(inpu
tElement)); | 661 m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(inpu
tElement)); |
662 | 662 |
663 // Notification that focus was lost. Be careful with this, it's also sent | 663 // Notification that focus was lost. Be careful with this, it's also sent |
664 // when the page is being closed. | 664 // when the page is being closed. |
665 | 665 |
666 // Hide any showing popup. | 666 // Hide any showing popup. |
667 m_webView->hideAutofillPopup(); | 667 m_webView->hideAutofillPopup(); |
668 } | 668 } |
669 | 669 |
670 void EditorClientImpl::textDidChangeInTextField(Element* element) | 670 void EditorClientImpl::textDidChangeInTextField(Element* element) |
671 { | 671 { |
672 ASSERT(element->hasLocalName(HTMLNames::inputTag)); | 672 ASSERT(element->hasLocalName(HTMLNames::inputTag)); |
673 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(element); | 673 Handle<HTMLInputElement> inputElement(static_cast<HTMLInputElement*>(element
)); |
674 if (m_webView->autofillClient()) | 674 if (m_webView->autofillClient()) |
675 m_webView->autofillClient()->textFieldDidChange(WebInputElement(inputEle
ment)); | 675 m_webView->autofillClient()->textFieldDidChange(WebInputElement(inputEle
ment)); |
676 } | 676 } |
677 | 677 |
678 bool EditorClientImpl::doTextFieldCommandFromEvent(Element* element, | 678 bool EditorClientImpl::doTextFieldCommandFromEvent(Element* element, |
679 KeyboardEvent* event) | 679 KeyboardEvent* event) |
680 { | 680 { |
681 HTMLInputElement* inputElement = element->toInputElement(); | 681 Handle<HTMLInputElement> inputElement = element->toInputElement(); |
682 if (m_webView->autofillClient() && inputElement) { | 682 if (m_webView->autofillClient() && inputElement) { |
683 m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(
inputElement), | 683 m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(
inputElement), |
684 WebKeyboardEvent
Builder(*event)); | 684 WebKeyboardEvent
Builder(*event)); |
685 } | 685 } |
686 | 686 |
687 // The Mac code appears to use this method as a hook to implement special | 687 // The Mac code appears to use this method as a hook to implement special |
688 // keyboard commands specific to Safari's auto-fill implementation. We | 688 // keyboard commands specific to Safari's auto-fill implementation. We |
689 // just return false to allow the default action. | 689 // just return false to allow the default action. |
690 return false; | 690 return false; |
691 } | 691 } |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
860 { | 860 { |
861 if (m_webView->client()) | 861 if (m_webView->client()) |
862 m_webView->client()->resetInputMethod(); | 862 m_webView->client()->resetInputMethod(); |
863 } | 863 } |
864 | 864 |
865 void EditorClientImpl::setInputMethodState(bool) | 865 void EditorClientImpl::setInputMethodState(bool) |
866 { | 866 { |
867 } | 867 } |
868 | 868 |
869 } // namesace WebKit | 869 } // namesace WebKit |
OLD | NEW |