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

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: 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 787 matching lines...) Expand 10 before | Expand all | Expand 10 after
798 return m_webView->requestPointerUnlock(); 798 return m_webView->requestPointerUnlock();
799 } 799 }
800 800
801 void ChromeClientImpl::annotatedRegionsChanged() 801 void ChromeClientImpl::annotatedRegionsChanged()
802 { 802 {
803 WebViewClient* client = m_webView->client(); 803 WebViewClient* client = m_webView->client();
804 if (client) 804 if (client)
805 client->draggableRegionsChanged(); 805 client->draggableRegionsChanged();
806 } 806 }
807 807
808 // FIXME: remove.
808 void ChromeClientImpl::didAssociateFormControls(const WillBeHeapVector<RefPtrWil lBeMember<Element> >& elements) 809 void ChromeClientImpl::didAssociateFormControls(const WillBeHeapVector<RefPtrWil lBeMember<Element> >& elements)
809 { 810 {
810 if (m_webView->autofillClient()) 811 if (m_webView->autofillClient())
811 m_webView->autofillClient()->didAssociateFormControls(elements); 812 m_webView->autofillClient()->didAssociateFormControls(elements);
812 } 813 }
813 814
815 void ChromeClientImpl::didAssociateFormControls(const WillBeHeapVector<RefPtrWil lBeMember<Element> >& elements, LocalFrame* frame)
816 {
817 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(frame);
818 if (webframe->autofillClient())
819 webframe->autofillClient()->didAssociateFormControls(elements);
Mike West 2014/11/19 10:27:45 If you add an `else if (m_webView->autofillClient(
Evan Stade 2014/11/19 22:16:41 Done.
820 }
821
814 void ChromeClientImpl::didCancelCompositionOnSelectionChange() 822 void ChromeClientImpl::didCancelCompositionOnSelectionChange()
815 { 823 {
816 if (m_webView->client()) 824 if (m_webView->client())
817 m_webView->client()->didCancelCompositionOnSelectionChange(); 825 m_webView->client()->didCancelCompositionOnSelectionChange();
818 } 826 }
819 827
820 void ChromeClientImpl::willSetInputMethodState() 828 void ChromeClientImpl::willSetInputMethodState()
821 { 829 {
822 if (m_webView->client()) 830 if (m_webView->client())
823 m_webView->client()->resetInputMethod(); 831 m_webView->client()->resetInputMethod();
824 } 832 }
825 833
826 void ChromeClientImpl::didUpdateTextOfFocusedElementByNonUserInput() 834 void ChromeClientImpl::didUpdateTextOfFocusedElementByNonUserInput()
827 { 835 {
828 if (m_webView->client()) 836 if (m_webView->client())
829 m_webView->client()->didUpdateTextOfFocusedElementByNonUserInput(); 837 m_webView->client()->didUpdateTextOfFocusedElementByNonUserInput();
830 } 838 }
831 839
832 void ChromeClientImpl::showImeIfNeeded() 840 void ChromeClientImpl::showImeIfNeeded()
833 { 841 {
834 if (m_webView->client()) 842 if (m_webView->client())
835 m_webView->client()->showImeIfNeeded(); 843 m_webView->client()->showImeIfNeeded();
836 } 844 }
837 845
838 void ChromeClientImpl::handleKeyboardEventOnTextField(HTMLInputElement& inputEle ment, KeyboardEvent& event) 846 void ChromeClientImpl::handleKeyboardEventOnTextField(HTMLInputElement& inputEle ment, KeyboardEvent& event)
839 { 847 {
840 if (!m_webView->autofillClient()) 848 // FIXME: remove.
Mike West 2014/11/19 10:27:45 Can you add a link to the bug here and elsewhere s
Evan Stade 2014/11/19 22:16:41 Done.
841 return; 849 if (m_webView->autofillClient())
842 m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(&inp utElement), WebKeyboardEventBuilder(event)); 850 m_webView->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement( &inputElement), WebKeyboardEventBuilder(event));
851 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(inputElement.docu ment().frame());
852 if (webframe->autofillClient())
853 webframe->autofillClient()->textFieldDidReceiveKeyDown(WebInputElement(& inputElement), WebKeyboardEventBuilder(event));
843 } 854 }
844 855
845 void ChromeClientImpl::didChangeValueInTextField(HTMLFormControlElement& element ) 856 void ChromeClientImpl::didChangeValueInTextField(HTMLFormControlElement& element )
846 { 857 {
847 if (!m_webView->autofillClient()) 858 // FIXME: remove.
848 return; 859 if (m_webView->autofillClient())
849 m_webView->autofillClient()->textFieldDidChange(WebFormControlElement(&eleme nt)); 860 m_webView->autofillClient()->textFieldDidChange(WebFormControlElement(&e lement));
861 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(element.document( ).frame());
862 if (webframe->autofillClient())
863 webframe->autofillClient()->textFieldDidChange(WebFormControlElement(&el ement));
850 } 864 }
851 865
852 void ChromeClientImpl::didEndEditingOnTextField(HTMLInputElement& inputElement) 866 void ChromeClientImpl::didEndEditingOnTextField(HTMLInputElement& inputElement)
853 { 867 {
868 // FIXME: remove.
854 if (m_webView->autofillClient()) 869 if (m_webView->autofillClient())
855 m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(&inp utElement)); 870 m_webView->autofillClient()->textFieldDidEndEditing(WebInputElement(&inp utElement));
871 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(inputElement.docu ment().frame());
872 if (webframe->autofillClient())
873 webframe->autofillClient()->textFieldDidEndEditing(WebInputElement(&inpu tElement));
856 } 874 }
857 875
858 void ChromeClientImpl::openTextDataListChooser(HTMLInputElement& input) 876 void ChromeClientImpl::openTextDataListChooser(HTMLInputElement& input)
859 { 877 {
878 // FIXME: remove.
860 if (m_webView->autofillClient()) 879 if (m_webView->autofillClient())
861 m_webView->autofillClient()->openTextDataListChooser(WebInputElement(&in put)); 880 m_webView->autofillClient()->openTextDataListChooser(WebInputElement(&in put));
881 WebLocalFrameImpl* webframe = WebLocalFrameImpl::fromFrame(input.document(). frame());
882 if (webframe->autofillClient())
883 webframe->autofillClient()->openTextDataListChooser(WebInputElement(&inp ut));
862 } 884 }
863 885
864 } // namespace blink 886 } // 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