| OLD | NEW |
| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 TouchTargetAndDispatchResultTypeMax, | 98 TouchTargetAndDispatchResultTypeMax, |
| 99 }; | 99 }; |
| 100 | 100 |
| 101 void logTouchTargetHistogram(EventTarget* eventTarget, unsigned short phase, boo
l defaultPreventedBeforeCurrentTarget, bool defaultPrevented) | 101 void logTouchTargetHistogram(EventTarget* eventTarget, unsigned short phase, boo
l defaultPreventedBeforeCurrentTarget, bool defaultPrevented) |
| 102 { | 102 { |
| 103 int result = 0; | 103 int result = 0; |
| 104 Document* document = nullptr; | 104 Document* document = nullptr; |
| 105 | 105 |
| 106 switch (phase) { | 106 switch (phase) { |
| 107 default: | 107 default: |
| 108 case Event::NONE: | 108 case Event::kNone: |
| 109 return; | 109 return; |
| 110 case Event::CAPTURING_PHASE: | 110 case Event::kCapturingPhase: |
| 111 result += kCapturingOffset; | 111 result += kCapturingOffset; |
| 112 break; | 112 break; |
| 113 case Event::AT_TARGET: | 113 case Event::kAtTarget: |
| 114 result += kAtTargetOffset; | 114 result += kAtTargetOffset; |
| 115 break; | 115 break; |
| 116 case Event::BUBBLING_PHASE: | 116 case Event::kBubblingPhase: |
| 117 result += kBubblingOffset; | 117 result += kBubblingOffset; |
| 118 break; | 118 break; |
| 119 } | 119 } |
| 120 | 120 |
| 121 if (const LocalDOMWindow* domWindow = eventTarget->toLocalDOMWindow()) { | 121 if (const LocalDOMWindow* domWindow = eventTarget->toLocalDOMWindow()) { |
| 122 // Treat the window as a root scroller as well. | 122 // Treat the window as a root scroller as well. |
| 123 document = domWindow->document(); | 123 document = domWindow->document(); |
| 124 result += kTouchTargetHistogramRootScrollerOffset; | 124 result += kTouchTargetHistogramRootScrollerOffset; |
| 125 } else if (Node* node = eventTarget->toNode()) { | 125 } else if (Node* node = eventTarget->toNode()) { |
| 126 // Report if the target node is the document or body. | 126 // Report if the target node is the document or body. |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 return toTouchEvent(EventDispatchMediator::event()); | 250 return toTouchEvent(EventDispatchMediator::event()); |
| 251 } | 251 } |
| 252 | 252 |
| 253 DispatchEventResult TouchEventDispatchMediator::dispatchEvent(EventDispatcher& d
ispatcher) const | 253 DispatchEventResult TouchEventDispatchMediator::dispatchEvent(EventDispatcher& d
ispatcher) const |
| 254 { | 254 { |
| 255 event().eventPath().adjustForTouchEvent(event()); | 255 event().eventPath().adjustForTouchEvent(event()); |
| 256 return dispatcher.dispatch(); | 256 return dispatcher.dispatch(); |
| 257 } | 257 } |
| 258 | 258 |
| 259 } // namespace blink | 259 } // namespace blink |
| OLD | NEW |