OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/renderer_host/render_widget_host_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
6 | 6 |
7 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
8 #include <QuartzCore/QuartzCore.h> | 8 #include <QuartzCore/QuartzCore.h> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 2036 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2047 mouse_locked_ = false; | 2047 mouse_locked_ = false; |
2048 | 2048 |
2049 // Unlock position of mouse cursor and unhide it. | 2049 // Unlock position of mouse cursor and unhide it. |
2050 CGAssociateMouseAndMouseCursorPosition(YES); | 2050 CGAssociateMouseAndMouseCursorPosition(YES); |
2051 [NSCursor unhide]; | 2051 [NSCursor unhide]; |
2052 | 2052 |
2053 if (render_widget_host_) | 2053 if (render_widget_host_) |
2054 render_widget_host_->LostMouseLock(); | 2054 render_widget_host_->LostMouseLock(); |
2055 } | 2055 } |
2056 | 2056 |
2057 void RenderWidgetHostViewMac::UnhandledWheelEvent( | 2057 void RenderWidgetHostViewMac::WheelEventAck( |
2058 const blink::WebMouseWheelEvent& event) { | 2058 const blink::WebMouseWheelEvent& event, |
| 2059 InputEventAckState ack_result) { |
| 2060 if (ack_result == INPUT_EVENT_ACK_STATE_CONSUMED) |
| 2061 return; |
| 2062 |
2059 // Only record a wheel event as unhandled if JavaScript handlers got a chance | 2063 // Only record a wheel event as unhandled if JavaScript handlers got a chance |
2060 // to see it (no-op wheel events are ignored by the event dispatcher) | 2064 // to see it (no-op wheel events are ignored by the event dispatcher) |
2061 if (event.deltaX || event.deltaY) | 2065 if (event.deltaX || event.deltaY) |
2062 [cocoa_view_ gotUnhandledWheelEvent]; | 2066 [cocoa_view_ gotUnhandledWheelEvent]; |
2063 } | 2067 } |
2064 | 2068 |
2065 bool RenderWidgetHostViewMac::Send(IPC::Message* message) { | 2069 bool RenderWidgetHostViewMac::Send(IPC::Message* message) { |
2066 if (render_widget_host_) | 2070 if (render_widget_host_) |
2067 return render_widget_host_->Send(message); | 2071 return render_widget_host_->Send(message); |
2068 delete message; | 2072 delete message; |
(...skipping 2400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4469 } | 4473 } |
4470 } | 4474 } |
4471 | 4475 |
4472 - (void)disableRendering { | 4476 - (void)disableRendering { |
4473 // Disable the fade-out animation as the layer is removed. | 4477 // Disable the fade-out animation as the layer is removed. |
4474 ScopedCAActionDisabler disabler; | 4478 ScopedCAActionDisabler disabler; |
4475 [self removeFromSuperlayer]; | 4479 [self removeFromSuperlayer]; |
4476 } | 4480 } |
4477 | 4481 |
4478 @end // implementation SoftwareLayer | 4482 @end // implementation SoftwareLayer |
OLD | NEW |