| OLD | NEW |
| 1 /** | 1 /** |
| 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
| 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) | 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
| 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 5 * Copyright (C) 2003, 2005, 2006, 2007 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2007 Apple Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 { | 52 { |
| 53 if (key.isKeypad()) | 53 if (key.isKeypad()) |
| 54 return KeyboardEvent::DOM_KEY_LOCATION_NUMPAD; | 54 return KeyboardEvent::DOM_KEY_LOCATION_NUMPAD; |
| 55 if (key.getModifiers() & PlatformEvent::IsLeft) | 55 if (key.getModifiers() & PlatformEvent::IsLeft) |
| 56 return KeyboardEvent::DOM_KEY_LOCATION_LEFT; | 56 return KeyboardEvent::DOM_KEY_LOCATION_LEFT; |
| 57 if (key.getModifiers() & PlatformEvent::IsRight) | 57 if (key.getModifiers() & PlatformEvent::IsRight) |
| 58 return KeyboardEvent::DOM_KEY_LOCATION_RIGHT; | 58 return KeyboardEvent::DOM_KEY_LOCATION_RIGHT; |
| 59 return KeyboardEvent::DOM_KEY_LOCATION_STANDARD; | 59 return KeyboardEvent::DOM_KEY_LOCATION_STANDARD; |
| 60 } | 60 } |
| 61 | 61 |
| 62 PassRefPtrWillBeRawPtr<KeyboardEvent> KeyboardEvent::create(ScriptState* scriptS
tate, const AtomicString& type, const KeyboardEventInit& initializer) | 62 RawPtr<KeyboardEvent> KeyboardEvent::create(ScriptState* scriptState, const Atom
icString& type, const KeyboardEventInit& initializer) |
| 63 { | 63 { |
| 64 if (scriptState->world().isIsolatedWorld()) | 64 if (scriptState->world().isIsolatedWorld()) |
| 65 UIEventWithKeyState::didCreateEventInIsolatedWorld(initializer.ctrlKey()
, initializer.altKey(), initializer.shiftKey(), initializer.metaKey()); | 65 UIEventWithKeyState::didCreateEventInIsolatedWorld(initializer.ctrlKey()
, initializer.altKey(), initializer.shiftKey(), initializer.metaKey()); |
| 66 return adoptRefWillBeNoop(new KeyboardEvent(type, initializer)); | 66 return new KeyboardEvent(type, initializer); |
| 67 } | 67 } |
| 68 | 68 |
| 69 KeyboardEvent::KeyboardEvent() | 69 KeyboardEvent::KeyboardEvent() |
| 70 : m_location(DOM_KEY_LOCATION_STANDARD) | 70 : m_location(DOM_KEY_LOCATION_STANDARD) |
| 71 { | 71 { |
| 72 } | 72 } |
| 73 | 73 |
| 74 KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* vie
w) | 74 KeyboardEvent::KeyboardEvent(const PlatformKeyboardEvent& key, AbstractView* vie
w) |
| 75 : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), true, true,
view, 0, key.getModifiers(), key.timestamp(), InputDeviceCapabilities::doesntFi
reTouchEventsSourceCapabilities()) | 75 : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), true, true,
view, 0, key.getModifiers(), key.timestamp(), InputDeviceCapabilities::doesntFi
reTouchEventsSourceCapabilities()) |
| 76 , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key))) | 76 , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key))) |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 break; | 191 break; |
| 192 } | 192 } |
| 193 } | 193 } |
| 194 | 194 |
| 195 DEFINE_TRACE(KeyboardEvent) | 195 DEFINE_TRACE(KeyboardEvent) |
| 196 { | 196 { |
| 197 UIEventWithKeyState::trace(visitor); | 197 UIEventWithKeyState::trace(visitor); |
| 198 } | 198 } |
| 199 | 199 |
| 200 } // namespace blink | 200 } // namespace blink |
| OLD | NEW |