Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(147)

Side by Side Diff: Source/web/ChromeClientImpl.cpp

Issue 737853002: Refactor Autofill for OOPIF, step 1: add autofillClient to WebLocalFrame (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fn ordering Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/web/ChromeClientImpl.h ('k') | Source/web/FrameLoaderClientImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 781 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 return m_webView->requestPointerUnlock(); 792 return m_webView->requestPointerUnlock();
793 } 793 }
794 794
795 void ChromeClientImpl::annotatedRegionsChanged() 795 void ChromeClientImpl::annotatedRegionsChanged()
796 { 796 {
797 WebViewClient* client = m_webView->client(); 797 WebViewClient* client = m_webView->client();
798 if (client) 798 if (client)
799 client->draggableRegionsChanged(); 799 client->draggableRegionsChanged();
800 } 800 }
801 801
802 void ChromeClientImpl::didAssociateFormControls(const WillBeHeapVector<RefPtrWil lBeMember<Element> >& elements) 802 void ChromeClientImpl::didAssociateFormControls(const WillBeHeapVector<RefPtrWil lBeMember<Element> >& elements, LocalFrame* frame)
803 { 803 {
804 // FIXME: remove. See http://crbug.com/425756
804 if (m_webView->autofillClient()) 805 if (m_webView->autofillClient())
805 m_webView->autofillClient()->didAssociateFormControls(elements); 806 m_webView->autofillClient()->didAssociateFormControls(elements);
807 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame);
808 if (webframe->autofillClient())
809 webframe->autofillClient()->didAssociateFormControls(elements);
806 } 810 }
807 811
808 void ChromeClientImpl::didCancelCompositionOnSelectionChange() 812 void ChromeClientImpl::didCancelCompositionOnSelectionChange()
809 { 813 {
810 if (m_webView->client()) 814 if (m_webView->client())
811 m_webView->client()->didCancelCompositionOnSelectionChange(); 815 m_webView->client()->didCancelCompositionOnSelectionChange();
812 } 816 }
813 817
814 void ChromeClientImpl::willSetInputMethodState() 818 void ChromeClientImpl::willSetInputMethodState()
815 { 819 {
816 if (m_webView->client()) 820 if (m_webView->client())
817 m_webView->client()->resetInputMethod(); 821 m_webView->client()->resetInputMethod();
818 } 822 }
819 823
820 void ChromeClientImpl::didUpdateTextOfFocusedElementByNonUserInput() 824 void ChromeClientImpl::didUpdateTextOfFocusedElementByNonUserInput()
821 { 825 {
822 if (m_webView->client()) 826 if (m_webView->client())
823 m_webView->client()->didUpdateTextOfFocusedElementByNonUserInput(); 827 m_webView->client()->didUpdateTextOfFocusedElementByNonUserInput();
824 } 828 }
825 829
826 void ChromeClientImpl::showImeIfNeeded() 830 void ChromeClientImpl::showImeIfNeeded()
827 { 831 {
828 if (m_webView->client()) 832 if (m_webView->client())
829 m_webView->client()->showImeIfNeeded(); 833 m_webView->client()->showImeIfNeeded();
830 } 834 }
831 835
832 void ChromeClientImpl::handleKeyboardEventOnTextField(HTMLInputElement& inputEle ment, KeyboardEvent& event) 836 void ChromeClientImpl::handleKeyboardEventOnTextField(HTMLInputElement& inputEle ment, KeyboardEvent& event)
833 { 837 {
834 if (!m_webView->autofillClient()) 838 // FIXME: remove. See http://crbug.com/425756
835 return; 839 if (m_webView->autofillClient())
836 m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(&inp utElement), WebKeyboardEventBuilder(event)); 840 m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement( &inputElement), WebKeyboardEventBuilder(event));
841 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(inputElement.docu ment().frame());
842 if (webframe->autofillClient())
843 webframe->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(& inputElement), WebKeyboardEventBuilder(event));
837 } 844 }
838 845
839 void ChromeClientImpl::didChangeValueInTextField(HTMLFormControlElement& element ) 846 void ChromeClientImpl::didChangeValueInTextField(HTMLFormControlElement& element )
840 { 847 {
841 if (!m_webView->autofillClient()) 848 // FIXME: remove. See http://crbug.com/425756
842 return; 849 if (m_webView->autofillClient())
843 m_webView->autofillClient()->textFieldDidChange(WebFormControlElement(&eleme nt)); 850 m_webView->autofillClient()->textFieldDidChange(WebFormControlElement(&e lement));
851 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(element.document( ).frame());
852 if (webframe->autofillClient())
853 webframe->autofillClient()->textFieldDidChange(WebFormControlElement(&el ement));
844 } 854 }
845 855
846 void ChromeClientImpl::didEndEditingOnTextField(HTMLInputElement& inputElement) 856 void ChromeClientImpl::didEndEditingOnTextField(HTMLInputElement& inputElement)
847 { 857 {
858 // FIXME: remove. See http://crbug.com/425756
848 if (m_webView->autofillClient()) 859 if (m_webView->autofillClient())
849 m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(&inp utElement)); 860 m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(&inp utElement));
861 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(inputElement.docu ment().frame());
862 if (webframe->autofillClient())
863 webframe->autofillClient()->textFieldDidEndEditing(WebInputElement(&inpu tElement));
850 } 864 }
851 865
852 void ChromeClientImpl::openTextDataListChooser(HTMLInputElement& input) 866 void ChromeClientImpl::openTextDataListChooser(HTMLInputElement& input)
853 { 867 {
868 // FIXME: remove. See http://crbug.com/425756
854 if (m_webView->autofillClient()) 869 if (m_webView->autofillClient())
855 m_webView->autofillClient()->openTextDataListChooser(WebInputElement(&in put)); 870 m_webView->autofillClient()->openTextDataListChooser(WebInputElement(&in put));
871 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(input.document(). frame());
872 if (webframe->autofillClient())
873 webframe->autofillClient()->openTextDataListChooser(WebInputElement(&inp ut));
856 } 874 }
857 875
858 void ChromeClientImpl::textFieldDataListChanged(HTMLFormControlElement& element) 876 void ChromeClientImpl::textFieldDataListChanged(HTMLFormControlElement& element)
859 { 877 {
860 if (!m_webView->autofillClient()) 878 if (!m_webView->autofillClient())
861 return; 879 return;
862 m_webView->autofillClient()->textFieldDidChange(WebFormControlElement(&eleme nt)); 880 m_webView->autofillClient()->textFieldDidChange(WebFormControlElement(&eleme nt));
863 } 881 }
864 882
865 } // namespace blink 883 } // namespace blink
OLDNEW
« no previous file with comments | « Source/web/ChromeClientImpl.h ('k') | Source/web/FrameLoaderClientImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698