OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |