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

Side by Side Diff: third_party/WebKit/Source/core/html/forms/SearchInputType.cpp

Issue 2045603002: Handle the "key" field as opposed to keyIdentifier field. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove initialization of the view Created 4 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * 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 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 container->insertBefore(SearchFieldCancelButtonElement::create(element().doc ument()), viewPort->nextSibling()); 87 container->insertBefore(SearchFieldCancelButtonElement::create(element().doc ument()), viewPort->nextSibling());
88 } 88 }
89 89
90 void SearchInputType::handleKeydownEvent(KeyboardEvent* event) 90 void SearchInputType::handleKeydownEvent(KeyboardEvent* event)
91 { 91 {
92 if (element().isDisabledOrReadOnly()) { 92 if (element().isDisabledOrReadOnly()) {
93 TextFieldInputType::handleKeydownEvent(event); 93 TextFieldInputType::handleKeydownEvent(event);
94 return; 94 return;
95 } 95 }
96 96
97 const String& key = event->keyIdentifier(); 97 const String& key = event->key();
98 if (key == "U+001B") { 98 if (key == "Escape") {
99 element().setValueForUser(""); 99 element().setValueForUser("");
100 element().onSearch(); 100 element().onSearch();
101 event->setDefaultHandled(); 101 event->setDefaultHandled();
102 return; 102 return;
103 } 103 }
104 TextFieldInputType::handleKeydownEvent(event); 104 TextFieldInputType::handleKeydownEvent(event);
105 } 105 }
106 106
107 void SearchInputType::startSearchEventTimer() 107 void SearchInputType::startSearchEventTimer()
108 { 108 {
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 button->removeInlineStyleProperty(CSSPropertyPointerEvents); 172 button->removeInlineStyleProperty(CSSPropertyPointerEvents);
173 } 173 }
174 } 174 }
175 175
176 bool SearchInputType::supportsInputModeAttribute() const 176 bool SearchInputType::supportsInputModeAttribute() const
177 { 177 {
178 return true; 178 return true;
179 } 179 }
180 180
181 } // namespace blink 181 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698