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 #import "base/mac/sdk_forward_declarations.h" | 10 #import "base/mac/sdk_forward_declarations.h" |
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
611 | 611 |
612 ui::MouseEvent event(theEvent); | 612 ui::MouseEvent event(theEvent); |
613 | 613 |
614 // Aura updates tooltips with the help of aura::Window::AddPreTargetHandler(). | 614 // Aura updates tooltips with the help of aura::Window::AddPreTargetHandler(). |
615 // Mac hooks in here. | 615 // Mac hooks in here. |
616 [self updateTooltipIfRequiredAt:event.location()]; | 616 [self updateTooltipIfRequiredAt:event.location()]; |
617 | 617 |
618 hostedView_->GetWidget()->OnMouseEvent(&event); | 618 hostedView_->GetWidget()->OnMouseEvent(&event); |
619 } | 619 } |
620 | 620 |
621 - (void)forceTouchEvent:(NSEvent*)theEvent { | |
622 // Perform word lookup on force touch. | |
tapted
2016/12/19 04:04:33
The comment probably isn't necessary, but I think
karandeepb
2016/12/19 04:28:20
Oh yeah, thanks for catching this.
| |
623 [self quickLookWithEvent:theEvent]; | |
624 } | |
625 | |
621 // NSView implementation. | 626 // NSView implementation. |
622 | 627 |
623 - (BOOL)acceptsFirstResponder { | 628 - (BOOL)acceptsFirstResponder { |
624 return YES; | 629 return YES; |
625 } | 630 } |
626 | 631 |
627 - (BOOL)becomeFirstResponder { | 632 - (BOOL)becomeFirstResponder { |
628 BOOL result = [super becomeFirstResponder]; | 633 BOOL result = [super becomeFirstResponder]; |
629 if (result && hostedView_) | 634 if (result && hostedView_) |
630 hostedView_->GetWidget()->GetFocusManager()->RestoreFocusedView(); | 635 hostedView_->GetWidget()->GetFocusManager()->RestoreFocusedView(); |
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1470 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; | 1475 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; |
1471 } | 1476 } |
1472 | 1477 |
1473 - (id)accessibilityFocusedUIElement { | 1478 - (id)accessibilityFocusedUIElement { |
1474 if (!hostedView_) | 1479 if (!hostedView_) |
1475 return nil; | 1480 return nil; |
1476 return [hostedView_->GetNativeViewAccessible() accessibilityFocusedUIElement]; | 1481 return [hostedView_->GetNativeViewAccessible() accessibilityFocusedUIElement]; |
1477 } | 1482 } |
1478 | 1483 |
1479 @end | 1484 @end |
OLD | NEW |