OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 3 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
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 are | 6 * modification, are permitted provided that the following conditions are |
7 * met: | 7 * met: |
8 * | 8 * |
9 * * Redistributions of source code must retain the above copyright | 9 * * Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 return m_webView->requestPointerUnlock(); | 794 return m_webView->requestPointerUnlock(); |
795 } | 795 } |
796 | 796 |
797 void ChromeClientImpl::annotatedRegionsChanged() | 797 void ChromeClientImpl::annotatedRegionsChanged() |
798 { | 798 { |
799 WebViewClient* client = m_webView->client(); | 799 WebViewClient* client = m_webView->client(); |
800 if (client) | 800 if (client) |
801 client->draggableRegionsChanged(); | 801 client->draggableRegionsChanged(); |
802 } | 802 } |
803 | 803 |
804 void ChromeClientImpl::didAssociateFormControls(const WillBeHeapVector<RefPtrWil
lBeMember<Element> >& elements) | 804 void ChromeClientImpl::didAssociateFormControls(const WillBeHeapVector<RefPtrWil
lBeMember<Element> >& elements, LocalFrame* frame) |
805 { | 805 { |
806 if (m_webView->autofillClient()) | 806 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame); |
807 m_webView->autofillClient()->didAssociateFormControls(elements); | 807 if (webframe->autofillClient()) |
| 808 webframe->autofillClient()->didAssociateFormControls(elements); |
808 } | 809 } |
809 | 810 |
810 void ChromeClientImpl::didCancelCompositionOnSelectionChange() | 811 void ChromeClientImpl::didCancelCompositionOnSelectionChange() |
811 { | 812 { |
812 if (m_webView->client()) | 813 if (m_webView->client()) |
813 m_webView->client()->didCancelCompositionOnSelectionChange(); | 814 m_webView->client()->didCancelCompositionOnSelectionChange(); |
814 } | 815 } |
815 | 816 |
816 void ChromeClientImpl::willSetInputMethodState() | 817 void ChromeClientImpl::willSetInputMethodState() |
817 { | 818 { |
818 if (m_webView->client()) | 819 if (m_webView->client()) |
819 m_webView->client()->resetInputMethod(); | 820 m_webView->client()->resetInputMethod(); |
820 } | 821 } |
821 | 822 |
822 void ChromeClientImpl::didUpdateTextOfFocusedElementByNonUserInput() | 823 void ChromeClientImpl::didUpdateTextOfFocusedElementByNonUserInput() |
823 { | 824 { |
824 if (m_webView->client()) | 825 if (m_webView->client()) |
825 m_webView->client()->didUpdateTextOfFocusedElementByNonUserInput(); | 826 m_webView->client()->didUpdateTextOfFocusedElementByNonUserInput(); |
826 } | 827 } |
827 | 828 |
828 void ChromeClientImpl::showImeIfNeeded() | 829 void ChromeClientImpl::showImeIfNeeded() |
829 { | 830 { |
830 if (m_webView->client()) | 831 if (m_webView->client()) |
831 m_webView->client()->showImeIfNeeded(); | 832 m_webView->client()->showImeIfNeeded(); |
832 } | 833 } |
833 | 834 |
834 void ChromeClientImpl::handleKeyboardEventOnTextField(HTMLInputElement& inputEle
ment, KeyboardEvent& event) | 835 void ChromeClientImpl::handleKeyboardEventOnTextField(HTMLInputElement& inputEle
ment, KeyboardEvent& event) |
835 { | 836 { |
836 if (!m_webView->autofillClient()) | 837 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(inputElement.docu
ment().frame()); |
837 return; | 838 if (webframe->autofillClient()) |
838 m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(&inp
utElement), WebKeyboardEventBuilder(event)); | 839 webframe->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(&
inputElement), WebKeyboardEventBuilder(event)); |
839 } | 840 } |
840 | 841 |
841 void ChromeClientImpl::didChangeValueInTextField(HTMLFormControlElement& element
) | 842 void ChromeClientImpl::didChangeValueInTextField(HTMLFormControlElement& element
) |
842 { | 843 { |
843 if (!m_webView->autofillClient()) | 844 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(element.document(
).frame()); |
844 return; | 845 if (webframe->autofillClient()) |
845 m_webView->autofillClient()->textFieldDidChange(WebFormControlElement(&eleme
nt)); | 846 webframe->autofillClient()->textFieldDidChange(WebFormControlElement(&el
ement)); |
846 } | 847 } |
847 | 848 |
848 void ChromeClientImpl::didEndEditingOnTextField(HTMLInputElement& inputElement) | 849 void ChromeClientImpl::didEndEditingOnTextField(HTMLInputElement& inputElement) |
849 { | 850 { |
850 if (m_webView->autofillClient()) | 851 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(inputElement.docu
ment().frame()); |
851 m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(&inp
utElement)); | 852 if (webframe->autofillClient()) |
| 853 webframe->autofillClient()->textFieldDidEndEditing(WebInputElement(&inpu
tElement)); |
852 } | 854 } |
853 | 855 |
854 void ChromeClientImpl::openTextDataListChooser(HTMLInputElement& input) | 856 void ChromeClientImpl::openTextDataListChooser(HTMLInputElement& input) |
855 { | 857 { |
856 if (m_webView->autofillClient()) | 858 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(input.document().
frame()); |
857 m_webView->autofillClient()->openTextDataListChooser(WebInputElement(&in
put)); | 859 if (webframe->autofillClient()) |
| 860 webframe->autofillClient()->openTextDataListChooser(WebInputElement(&inp
ut)); |
858 } | 861 } |
859 | 862 |
860 } // namespace blink | 863 } // namespace blink |
OLD | NEW |