Chromium Code Reviews| Index: ui/views/cocoa/bridged_content_view.mm |
| diff --git a/ui/views/cocoa/bridged_content_view.mm b/ui/views/cocoa/bridged_content_view.mm |
| index 1623e32b8ede82ff2b578ad5500010dca09f991c..0aa6a95cfe3e90c1f4d2a4ebb0dfc0482dcf5683 100644 |
| --- a/ui/views/cocoa/bridged_content_view.mm |
| +++ b/ui/views/cocoa/bridged_content_view.mm |
| @@ -305,6 +305,51 @@ ui::KeyEvent GetCharacterEventFromNSEvent(NSEvent* event) { |
| [self removeTrackingArea:cursorTrackingArea_.get()]; |
| } |
| +- (void)resendCapturedMouseEvent:(NSEvent*)theEvent { |
|
tapted
2016/09/19 00:31:01
I think this method has no effect in combination w
snake
2016/09/20 15:04:26
We can use #if !defined(TOOLKIT_VIEWS) macros in b
tapted
2016/09/21 10:07:05
TOOLKIT_VIEWS is always defined on Mac, so that wo
snake
2016/09/21 12:29:52
Done.
|
| + // We should resend messages by type, to correct processing it in |
| + // base_view.mm. |
| + switch ([theEvent type]) { |
| + case NSLeftMouseDown: |
| + [self mouseDown:theEvent]; |
| + break; |
| + case NSLeftMouseUp: |
| + [self mouseUp:theEvent]; |
| + break; |
| + case NSRightMouseDown: |
| + [self rightMouseDown:theEvent]; |
| + break; |
| + case NSRightMouseUp: |
| + [self rightMouseUp:theEvent]; |
| + break; |
| + case NSOtherMouseDown: |
| + [self otherMouseDown:theEvent]; |
| + break; |
| + case NSOtherMouseUp: |
| + [self otherMouseUp:theEvent]; |
| + break; |
| + case NSMouseMoved: |
| + [self mouseMoved:theEvent]; |
| + break; |
| + case NSLeftMouseDragged: |
| + [self mouseDragged:theEvent]; |
| + break; |
| + case NSRightMouseDragged: |
| + [self rightMouseDragged:theEvent]; |
| + break; |
| + case NSOtherMouseDragged: |
| + [self otherMouseDragged:theEvent]; |
| + break; |
| + case NSMouseEntered: |
| + [self mouseEntered:theEvent]; |
| + break; |
| + case NSMouseExited: |
| + [self mouseExited:theEvent]; |
| + break; |
| + default: |
| + [self mouseEvent:theEvent]; |
| + } |
| +} |
| + |
| - (void)processCapturedMouseEvent:(NSEvent*)theEvent { |
| if (!hostedView_) |
| return; |
| @@ -315,7 +360,7 @@ ui::KeyEvent GetCharacterEventFromNSEvent(NSEvent* event) { |
| // If it's the view's window, process normally. |
| if ([target isEqual:source]) { |
| - [self mouseEvent:theEvent]; |
| + [self resendCapturedMouseEvent:theEvent]; |
| return; |
| } |