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

Side by Side Diff: Source/WebKit/chromium/src/EditorClientImpl.cpp

Issue 16081007: Introduce toHTMLInputElement(Node*), and use it. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months 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 | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « Source/WebKit/chromium/src/DOMUtilitiesPrivate.cpp ('k') | Source/WebKit/chromium/src/WebInputElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698