| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/views/cocoa/bridged_content_view.h" | 5 #import "ui/views/cocoa/bridged_content_view.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #import "base/mac/mac_util.h" | 8 #import "base/mac/mac_util.h" |
| 9 #import "base/mac/scoped_nsobject.h" | 9 #import "base/mac/scoped_nsobject.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 705 keyDownEvent_ = theEvent; | 705 keyDownEvent_ = theEvent; |
| 706 [self interpretKeyEvents:@[ theEvent ]]; | 706 [self interpretKeyEvents:@[ theEvent ]]; |
| 707 keyDownEvent_ = nil; | 707 keyDownEvent_ = nil; |
| 708 } | 708 } |
| 709 | 709 |
| 710 - (void)keyUp:(NSEvent*)theEvent { | 710 - (void)keyUp:(NSEvent*)theEvent { |
| 711 ui::KeyEvent event(theEvent); | 711 ui::KeyEvent event(theEvent); |
| 712 [self handleKeyEvent:&event]; | 712 [self handleKeyEvent:&event]; |
| 713 } | 713 } |
| 714 | 714 |
| 715 - (BOOL)wantsScrollEventsForSwipeTrackingOnAxis:(NSEventGestureAxis)axis { |
| 716 return YES; |
| 717 } |
| 718 |
| 715 - (void)scrollWheel:(NSEvent*)theEvent { | 719 - (void)scrollWheel:(NSEvent*)theEvent { |
| 716 if (!hostedView_) | 720 if (!hostedView_) |
| 717 return; | 721 return; |
| 718 | 722 |
| 719 ui::MouseWheelEvent event(theEvent); | 723 ui::ScrollEvent event(theEvent); |
| 720 hostedView_->GetWidget()->OnMouseEvent(&event); | 724 hostedView_->GetWidget()->OnScrollEvent(&event); |
| 721 } | 725 } |
| 722 | 726 |
| 723 //////////////////////////////////////////////////////////////////////////////// | 727 //////////////////////////////////////////////////////////////////////////////// |
| 724 // NSResponder Action Messages. Keep sorted according NSResponder.h (from the | 728 // NSResponder Action Messages. Keep sorted according NSResponder.h (from the |
| 725 // 10.9 SDK). The list should eventually be complete. Anything not defined will | 729 // 10.9 SDK). The list should eventually be complete. Anything not defined will |
| 726 // beep when interpretKeyEvents: would otherwise call it. | 730 // beep when interpretKeyEvents: would otherwise call it. |
| 727 // TODO(tapted): Make this list complete, except for insert* methods which are | 731 // TODO(tapted): Make this list complete, except for insert* methods which are |
| 728 // dispatched as regular key events in doCommandBySelector:. | 732 // dispatched as regular key events in doCommandBySelector:. |
| 729 | 733 |
| 730 // views::Textfields are single-line only, map Paragraph and Document commands | 734 // views::Textfields are single-line only, map Paragraph and Document commands |
| (...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1281 } | 1285 } |
| 1282 | 1286 |
| 1283 return [super accessibilityAttributeValue:attribute]; | 1287 return [super accessibilityAttributeValue:attribute]; |
| 1284 } | 1288 } |
| 1285 | 1289 |
| 1286 - (id)accessibilityHitTest:(NSPoint)point { | 1290 - (id)accessibilityHitTest:(NSPoint)point { |
| 1287 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; | 1291 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; |
| 1288 } | 1292 } |
| 1289 | 1293 |
| 1290 @end | 1294 @end |
| OLD | NEW |