OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 KeyboardEvent* keyboardEvent) { | 77 KeyboardEvent* keyboardEvent) { |
78 if (keyboardEvent->type() != EventTypeNames::keypress) | 78 if (keyboardEvent->type() != EventTypeNames::keypress) |
79 return; | 79 return; |
80 | 80 |
81 const UChar charCode = WTF::Unicode::toLower(keyboardEvent->charCode()); | 81 const UChar charCode = WTF::Unicode::toLower(keyboardEvent->charCode()); |
82 if (charCode < ' ') | 82 if (charCode < ' ') |
83 return; | 83 return; |
84 | 84 |
85 keyboardEvent->setDefaultHandled(); | 85 keyboardEvent->setDefaultHandled(); |
86 | 86 |
87 int index = m_typeAhead.handleEvent( | 87 int index = m_typeAhead.handleEvent(keyboardEvent, |
88 keyboardEvent, TypeAhead::MatchPrefix | TypeAhead::CycleFirstChar | | 88 TypeAhead::MatchPrefix | |
89 TypeAhead::MatchIndex); | 89 TypeAhead::CycleFirstChar | |
| 90 TypeAhead::MatchIndex); |
90 if (index < 0) | 91 if (index < 0) |
91 return; | 92 return; |
92 setValueAsInteger(index, DispatchEvent); | 93 setValueAsInteger(index, DispatchEvent); |
93 } | 94 } |
94 | 95 |
95 bool DateTimeSymbolicFieldElement::hasValue() const { | 96 bool DateTimeSymbolicFieldElement::hasValue() const { |
96 return m_selectedIndex >= 0; | 97 return m_selectedIndex >= 0; |
97 } | 98 } |
98 | 99 |
99 void DateTimeSymbolicFieldElement::initialize(const AtomicString& pseudo, | 100 void DateTimeSymbolicFieldElement::initialize(const AtomicString& pseudo, |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 168 |
168 int DateTimeSymbolicFieldElement::optionCount() const { | 169 int DateTimeSymbolicFieldElement::optionCount() const { |
169 return m_symbols.size(); | 170 return m_symbols.size(); |
170 } | 171 } |
171 | 172 |
172 String DateTimeSymbolicFieldElement::optionAtIndex(int index) const { | 173 String DateTimeSymbolicFieldElement::optionAtIndex(int index) const { |
173 return m_symbols[index]; | 174 return m_symbols[index]; |
174 } | 175 } |
175 | 176 |
176 } // namespace blink | 177 } // namespace blink |
OLD | NEW |