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

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

Issue 1479923002: Enumerate the return value of dispatchEvent so it is clear. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master_passive_uma_add
Patch Set: Rebase Created 5 years 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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 break; 186 break;
187 case KeyboardEvent::DOM_KEY_LOCATION_LEFT: 187 case KeyboardEvent::DOM_KEY_LOCATION_LEFT:
188 m_modifiers |= PlatformEvent::IsLeft; 188 m_modifiers |= PlatformEvent::IsLeft;
189 break; 189 break;
190 case KeyboardEvent::DOM_KEY_LOCATION_RIGHT: 190 case KeyboardEvent::DOM_KEY_LOCATION_RIGHT:
191 m_modifiers |= PlatformEvent::IsRight; 191 m_modifiers |= PlatformEvent::IsRight;
192 break; 192 break;
193 } 193 }
194 } 194 }
195 195
196 PassRefPtrWillBeRawPtr<EventDispatchMediator> KeyboardEvent::createMediator()
197 {
198 return KeyboardEventDispatchMediator::create(this);
199 }
200
201 DEFINE_TRACE(KeyboardEvent) 196 DEFINE_TRACE(KeyboardEvent)
202 { 197 {
203 UIEventWithKeyState::trace(visitor); 198 UIEventWithKeyState::trace(visitor);
204 } 199 }
205 200
206 PassRefPtrWillBeRawPtr<KeyboardEventDispatchMediator> KeyboardEventDispatchMedia tor::create(PassRefPtrWillBeRawPtr<KeyboardEvent> event)
207 {
208 return adoptRefWillBeNoop(new KeyboardEventDispatchMediator(event));
209 }
210
211 KeyboardEventDispatchMediator::KeyboardEventDispatchMediator(PassRefPtrWillBeRaw Ptr<KeyboardEvent> event)
212 : EventDispatchMediator(event)
213 {
214 }
215
216 bool KeyboardEventDispatchMediator::dispatchEvent(EventDispatcher& dispatcher) c onst
217 {
218 // Make sure not to return true if we already took default action while hand ling the event.
219 return EventDispatchMediator::dispatchEvent(dispatcher) && !event().defaultH andled();
220 }
221
222 } // namespace blink 201 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698