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

Side by Side Diff: third_party/WebKit/Source/core/events/KeyboardEvent.cpp

Issue 1686483002: Oilpan: Remove most WillBe types from the code base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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) 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
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.modifiers() & PlatformEvent::IsLeft) 55 if (key.modifiers() & PlatformEvent::IsLeft)
56 return KeyboardEvent::DOM_KEY_LOCATION_LEFT; 56 return KeyboardEvent::DOM_KEY_LOCATION_LEFT;
57 if (key.modifiers() & PlatformEvent::IsRight) 57 if (key.modifiers() & 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.modifiers(), key.timestamp(), InputDeviceCapabilities::doesntFireT ouchEventsSourceCapabilities()) 75 : UIEventWithKeyState(eventTypeForKeyboardEventType(key.type()), true, true, view, 0, key.modifiers(), key.timestamp(), InputDeviceCapabilities::doesntFireT ouchEventsSourceCapabilities())
76 , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key))) 76 , m_keyEvent(adoptPtr(new PlatformKeyboardEvent(key)))
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 break; 185 break;
186 case KeyboardEvent::DOM_KEY_LOCATION_LEFT: 186 case KeyboardEvent::DOM_KEY_LOCATION_LEFT:
187 m_modifiers |= PlatformEvent::IsLeft; 187 m_modifiers |= PlatformEvent::IsLeft;
188 break; 188 break;
189 case KeyboardEvent::DOM_KEY_LOCATION_RIGHT: 189 case KeyboardEvent::DOM_KEY_LOCATION_RIGHT:
190 m_modifiers |= PlatformEvent::IsRight; 190 m_modifiers |= PlatformEvent::IsRight;
191 break; 191 break;
192 } 192 }
193 } 193 }
194 194
195 PassRefPtrWillBeRawPtr<EventDispatchMediator> KeyboardEvent::createMediator() 195 RawPtr<EventDispatchMediator> KeyboardEvent::createMediator()
196 { 196 {
197 return KeyboardEventDispatchMediator::create(this); 197 return KeyboardEventDispatchMediator::create(this);
198 } 198 }
199 199
200 DEFINE_TRACE(KeyboardEvent) 200 DEFINE_TRACE(KeyboardEvent)
201 { 201 {
202 UIEventWithKeyState::trace(visitor); 202 UIEventWithKeyState::trace(visitor);
203 } 203 }
204 204
205 PassRefPtrWillBeRawPtr<KeyboardEventDispatchMediator> KeyboardEventDispatchMedia tor::create(PassRefPtrWillBeRawPtr<KeyboardEvent> event) 205 RawPtr<KeyboardEventDispatchMediator> KeyboardEventDispatchMediator::create(RawP tr<KeyboardEvent> event)
206 { 206 {
207 return adoptRefWillBeNoop(new KeyboardEventDispatchMediator(event)); 207 return (new KeyboardEventDispatchMediator(event));
208 } 208 }
209 209
210 KeyboardEventDispatchMediator::KeyboardEventDispatchMediator(PassRefPtrWillBeRaw Ptr<KeyboardEvent> event) 210 KeyboardEventDispatchMediator::KeyboardEventDispatchMediator(RawPtr<KeyboardEven t> event)
211 : EventDispatchMediator(event) 211 : EventDispatchMediator(event)
212 { 212 {
213 } 213 }
214 214
215 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) c onst 215 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) c onst
216 { 216 {
217 // Make sure not to return true if we already took default action while hand ling the event. 217 // Make sure not to return true if we already took default action while hand ling the event.
218 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH andled(); 218 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH andled();
219 } 219 }
220 220
221 } // namespace blink 221 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698