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 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 | 613 |
614 // Notification that focus was lost. Be careful with this, it's also sent | 614 // Notification that focus was lost. Be careful with this, it's also sent |
615 // when the page is being closed. | 615 // when the page is being closed. |
616 | 616 |
617 // Hide any showing popup. | 617 // Hide any showing popup. |
618 m_webView->hideAutofillPopup(); | 618 m_webView->hideAutofillPopup(); |
619 } | 619 } |
620 | 620 |
621 void EditorClientImpl::textDidChangeInTextField(Element* element) | 621 void EditorClientImpl::textDidChangeInTextField(Element* element) |
622 { | 622 { |
623 ASSERT(element->hasLocalName(HTMLNames::inputTag)); | 623 HTMLInputElement* inputElement = toHTMLInputElement(element); |
624 HTMLInputElement* inputElement = static_cast<HTMLInputElement*>(element); | |
625 if (m_webView->autofillClient()) | 624 if (m_webView->autofillClient()) |
626 m_webView->autofillClient()->textFieldDidChange(WebInputElement(inputEle
ment)); | 625 m_webView->autofillClient()->textFieldDidChange(WebInputElement(inputEle
ment)); |
627 } | 626 } |
628 | 627 |
629 bool EditorClientImpl::doTextFieldCommandFromEvent(Element* element, | 628 bool EditorClientImpl::doTextFieldCommandFromEvent(Element* element, |
630 KeyboardEvent* event) | 629 KeyboardEvent* event) |
631 { | 630 { |
632 HTMLInputElement* inputElement = element->toInputElement(); | 631 HTMLInputElement* inputElement = element->toInputElement(); |
633 if (m_webView->autofillClient() && inputElement) { | 632 if (m_webView->autofillClient() && inputElement) { |
634 m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(
inputElement), | 633 m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(
inputElement), |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
762 #endif | 761 #endif |
763 } | 762 } |
764 | 763 |
765 void EditorClientImpl::willSetInputMethodState() | 764 void EditorClientImpl::willSetInputMethodState() |
766 { | 765 { |
767 if (m_webView->client()) | 766 if (m_webView->client()) |
768 m_webView->client()->resetInputMethod(); | 767 m_webView->client()->resetInputMethod(); |
769 } | 768 } |
770 | 769 |
771 } // namesace WebKit | 770 } // namesace WebKit |
OLD | NEW |