| 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 6d72fef5cf7ece1d35262f4b7b1a572622710f05..95d84887cf77f131efa7fb0f89c4dc0dc2763b3c 100644
|
| --- a/ui/views/cocoa/bridged_content_view.mm
|
| +++ b/ui/views/cocoa/bridged_content_view.mm
|
| @@ -160,6 +160,12 @@ gfx::Rect GetFirstRectForRangeHelper(const ui::TextInputClient* client,
|
| return union_rect;
|
| }
|
|
|
| +NSAttributedString* AttributedStringFromRenderText(
|
| + const gfx::RenderText* render_text,
|
| + const gfx::Range& range) {
|
| + return ...
|
| +}
|
| +
|
| } // namespace
|
|
|
| @interface BridgedContentView ()
|
| @@ -403,6 +409,28 @@ gfx::Rect GetFirstRectForRangeHelper(const ui::TextInputClient* client,
|
| hostedView_->GetWidget()->OnMouseEvent(&event);
|
| }
|
|
|
| +- (void)forceTouchEvent:(NSEvent*)theEvent {
|
| + if (!textInputClient_ || !ui::ForceTouchInvokesQuickLook())
|
| + return;
|
| +
|
| + ui::MouseEvent event(theEvent);
|
| + gfx::Range range;
|
| + gfx::Point baselinePoint;
|
| + const gfx::RenderText* renderText =
|
| + textInputClient_->GetStringAtPointInWindow(event.location(), &range,
|
| + &baselinePoint);
|
| + if (!renderText)
|
| + return;
|
| +
|
| + NSAttributedString* attributedString =
|
| + AttributedStringFromRenderText(renderText, range);
|
| +
|
| + dispatch_async(dispatch_get_main_queue(), ^{
|
| + [self showDefinitionForAttributedString:attributedString
|
| + atPoint:baselinePoint];
|
| + });
|
| +}
|
| +
|
| // NSView implementation.
|
|
|
| - (BOOL)acceptsFirstResponder {
|
|
|