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

Side by Side Diff: Source/core/events/TouchEvent.cpp

Issue 683013002: Extract a DOMWindow interface from LocalDOMWindow and use it in the idl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: whee Created 6 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright 2008, The Android Open Source Project 2 * Copyright 2008, The Android Open Source Project
3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved. 3 * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright 10 * * Redistributions in binary form must reproduce the above copyright
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 return true; 89 return true;
90 } 90 }
91 91
92 void TouchEvent::preventDefault() 92 void TouchEvent::preventDefault()
93 { 93 {
94 UIEventWithKeyState::preventDefault(); 94 UIEventWithKeyState::preventDefault();
95 95
96 // A common developer error is to wait too long before attempting to stop 96 // A common developer error is to wait too long before attempting to stop
97 // scrolling by consuming a touchmove event. Generate a warning if this 97 // scrolling by consuming a touchmove event. Generate a warning if this
98 // event is uncancelable. 98 // event is uncancelable.
99 if (!cancelable() && view() && view()->frame()) { 99 if (!cancelable() && view() && view()->frame() && view()->frame()->isLocalFr ame()) {
100 view()->frame()->console().addMessage(ConsoleMessage::create(JSMessageSo urce, WarningMessageLevel, 100 toLocalFrame(view()->frame())->console().addMessage(ConsoleMessage::crea te(JSMessageSource, WarningMessageLevel,
101 "Ignored attempt to cancel a " + type() + " event with cancelable=fa lse, for example because scrolling is in progress and cannot be interrupted.")); 101 "Ignored attempt to cancel a " + type() + " event with cancelable=fa lse, for example because scrolling is in progress and cannot be interrupted."));
102 } 102 }
103 } 103 }
104 void TouchEvent::trace(Visitor* visitor) 104 void TouchEvent::trace(Visitor* visitor)
105 { 105 {
106 visitor->trace(m_touches); 106 visitor->trace(m_touches);
107 visitor->trace(m_targetTouches); 107 visitor->trace(m_targetTouches);
108 visitor->trace(m_changedTouches); 108 visitor->trace(m_changedTouches);
109 UIEventWithKeyState::trace(visitor); 109 UIEventWithKeyState::trace(visitor);
110 } 110 }
(...skipping 13 matching lines...) Expand all
124 return toTouchEvent(EventDispatchMediator::event()); 124 return toTouchEvent(EventDispatchMediator::event());
125 } 125 }
126 126
127 bool TouchEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons t 127 bool TouchEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) cons t
128 { 128 {
129 event()->eventPath().adjustForTouchEvent(dispatcher->node(), *event()); 129 event()->eventPath().adjustForTouchEvent(dispatcher->node(), *event());
130 return dispatcher->dispatch(); 130 return dispatcher->dispatch();
131 } 131 }
132 132
133 } // namespace blink 133 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698