OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history
_swiper.h" | 5 #import "chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history
_swiper.h" |
6 | 6 |
7 #import "base/mac/sdk_forward_declarations.h" | 7 #import "base/mac/sdk_forward_declarations.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
10 #include "chrome/browser/ui/browser_finder.h" | 10 #include "chrome/browser/ui/browser_finder.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 | 124 |
125 - (void)rendererHandledGestureScrollEvent:(const blink::WebGestureEvent&)event | 125 - (void)rendererHandledGestureScrollEvent:(const blink::WebGestureEvent&)event |
126 consumed:(BOOL)consumed { | 126 consumed:(BOOL)consumed { |
127 switch (event.GetType()) { | 127 switch (event.GetType()) { |
128 case blink::WebInputEvent::kGestureScrollBegin: | 128 case blink::WebInputEvent::kGestureScrollBegin: |
129 if (event.data.scroll_begin.synthetic || | 129 if (event.data.scroll_begin.synthetic || |
130 event.data.scroll_begin.inertial_phase == | 130 event.data.scroll_begin.inertial_phase == |
131 blink::WebGestureEvent::kMomentumPhase) { | 131 blink::WebGestureEvent::kMomentumPhase) { |
132 return; | 132 return; |
133 } | 133 } |
| 134 // GestureScrollBegin and GestureScrollEnd events are created to wrap |
| 135 // individual resent GestureScrollUpdates from a plugin. Hence these |
| 136 // should not be used to indicate the beginning/end of the swipe gesture. |
| 137 // TODO(mcnee): When we remove BrowserPlugin, delete this code. |
| 138 // See crbug.com/533069 |
| 139 if (event.resending_plugin_id != -1) { |
| 140 return; |
| 141 } |
134 waitingForFirstGestureScroll_ = YES; | 142 waitingForFirstGestureScroll_ = YES; |
135 break; | 143 break; |
136 case blink::WebInputEvent::kGestureScrollUpdate: | 144 case blink::WebInputEvent::kGestureScrollUpdate: |
137 if (waitingForFirstGestureScroll_) | 145 if (waitingForFirstGestureScroll_) |
138 firstScrollUnconsumed_ = !consumed; | 146 firstScrollUnconsumed_ = !consumed; |
139 waitingForFirstGestureScroll_ = NO; | 147 waitingForFirstGestureScroll_ = NO; |
140 break; | 148 break; |
141 default: | 149 default: |
142 break; | 150 break; |
143 } | 151 } |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 } | 592 } |
585 } | 593 } |
586 | 594 |
587 @end | 595 @end |
588 | 596 |
589 @implementation HistorySwiper (PrivateExposedForTesting) | 597 @implementation HistorySwiper (PrivateExposedForTesting) |
590 + (void)resetMagicMouseState { | 598 + (void)resetMagicMouseState { |
591 forceMagicMouse = NO; | 599 forceMagicMouse = NO; |
592 } | 600 } |
593 @end | 601 @end |
OLD | NEW |