| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). | 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
| 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 3 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 4 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights | 6 * Copyright (C) 2004, 2005, 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights |
| 7 * reserved. | 7 * reserved. |
| 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) | 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) |
| 9 * Copyright (C) 2010 Google Inc. All rights reserved. | 9 * Copyright (C) 2010 Google Inc. All rights reserved. |
| 10 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. | 10 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 25 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 26 * Boston, MA 02110-1301, USA. | 26 * Boston, MA 02110-1301, USA. |
| 27 * | 27 * |
| 28 */ | 28 */ |
| 29 | 29 |
| 30 #include "core/html/forms/TypeAhead.h" | 30 #include "core/html/forms/TypeAhead.h" |
| 31 | 31 |
| 32 #include "core/events/KeyboardEvent.h" | 32 #include "core/events/KeyboardEvent.h" |
| 33 #include "wtf/text/CharacterNames.h" | 33 #include "wtf/text/CharacterNames.h" |
| 34 | 34 |
| 35 using namespace WTF::Unicode; | |
| 36 | |
| 37 namespace blink { | 35 namespace blink { |
| 38 | 36 |
| 39 TypeAhead::TypeAhead(TypeAheadDataSource* dataSource) | 37 TypeAhead::TypeAhead(TypeAheadDataSource* dataSource) |
| 40 : m_dataSource(dataSource), m_repeatingChar(0) {} | 38 : m_dataSource(dataSource), m_repeatingChar(0) {} |
| 41 | 39 |
| 42 static const TimeDelta typeAheadTimeout = TimeDelta::FromSecondsD(1); | 40 static const TimeDelta typeAheadTimeout = TimeDelta::FromSecondsD(1); |
| 43 | 41 |
| 44 static String stripLeadingWhiteSpace(const String& string) { | 42 static String stripLeadingWhiteSpace(const String& string) { |
| 45 unsigned length = string.length(); | 43 unsigned length = string.length(); |
| 46 | 44 |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 TimeDelta delta = event->platformTimeStamp() - m_lastTypeTime; | 119 TimeDelta delta = event->platformTimeStamp() - m_lastTypeTime; |
| 122 return delta <= typeAheadTimeout; | 120 return delta <= typeAheadTimeout; |
| 123 } | 121 } |
| 124 | 122 |
| 125 void TypeAhead::resetSession() { | 123 void TypeAhead::resetSession() { |
| 126 m_lastTypeTime = TimeTicks(); | 124 m_lastTypeTime = TimeTicks(); |
| 127 m_buffer.clear(); | 125 m_buffer.clear(); |
| 128 } | 126 } |
| 129 | 127 |
| 130 } // namespace blink | 128 } // namespace blink |
| OLD | NEW |