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

Unified Diff: Source/core/html/forms/BaseClickableWithKeyInputType.cpp

Issue 27746003: Have InputType factories take an HTMLInputElement reference in parameter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: Source/core/html/forms/BaseClickableWithKeyInputType.cpp
diff --git a/Source/core/html/forms/BaseClickableWithKeyInputType.cpp b/Source/core/html/forms/BaseClickableWithKeyInputType.cpp
index 0ab16adc3be84761e876351944ccde8ea86456ff..21823ba4f17b5b6870df2f0dda51c0ca1d3ec1bc 100644
--- a/Source/core/html/forms/BaseClickableWithKeyInputType.cpp
+++ b/Source/core/html/forms/BaseClickableWithKeyInputType.cpp
@@ -39,21 +39,21 @@ namespace WebCore {
using namespace HTMLNames;
-void BaseClickableWithKeyInputType::handleKeydownEvent(HTMLInputElement* element, KeyboardEvent* event)
+void BaseClickableWithKeyInputType::handleKeydownEvent(HTMLInputElement& element, KeyboardEvent* event)
{
const String& key = event->keyIdentifier();
if (key == "U+0020") {
- element->setActive(true, true);
+ element.setActive(true, true);
// No setDefaultHandled(), because IE dispatches a keypress in this case
// and the caller will only dispatch a keypress if we don't call setDefaultHandled().
}
}
-void BaseClickableWithKeyInputType::handleKeypressEvent(HTMLInputElement* element, KeyboardEvent* event)
+void BaseClickableWithKeyInputType::handleKeypressEvent(HTMLInputElement& element, KeyboardEvent* event)
{
int charCode = event->charCode();
if (charCode == '\r') {
- element->dispatchSimulatedClick(event);
+ element.dispatchSimulatedClick(event);
event->setDefaultHandled();
return;
}
@@ -73,9 +73,9 @@ void BaseClickableWithKeyInputType::handleKeyupEvent(InputType& inputType, Keybo
}
// FIXME: Could share this with BaseCheckableInputType and RangeInputType if we had a common base class.
-void BaseClickableWithKeyInputType::accessKeyAction(HTMLInputElement* element, bool sendMouseEvents)
+void BaseClickableWithKeyInputType::accessKeyAction(HTMLInputElement& element, bool sendMouseEvents)
{
- element->dispatchSimulatedClick(0, sendMouseEvents ? SendMouseUpDownEvents : SendNoEvents);
+ element.dispatchSimulatedClick(0, sendMouseEvents ? SendMouseUpDownEvents : SendNoEvents);
}
void BaseClickableWithKeyInputType::handleKeydownEvent(KeyboardEvent* event)
« no previous file with comments | « Source/core/html/forms/BaseClickableWithKeyInputType.h ('k') | Source/core/html/forms/BaseDateAndTimeInputType.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698