Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(223)

Side by Side Diff: ui/views/cocoa/bridged_content_view.mm

Issue 2587833002: MacViews: Perform word lookup on force touch. (Closed)
Patch Set: Address review. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "base/strings/sys_string_conversions.h" 11 #include "base/strings/sys_string_conversions.h"
12 #include "skia/ext/skia_utils_mac.h" 12 #include "skia/ext/skia_utils_mac.h"
13 #import "ui/base/cocoa/appkit_utils.h"
13 #include "ui/base/cocoa/cocoa_base_utils.h" 14 #include "ui/base/cocoa/cocoa_base_utils.h"
14 #include "ui/base/dragdrop/drag_drop_types.h" 15 #include "ui/base/dragdrop/drag_drop_types.h"
15 #include "ui/base/dragdrop/os_exchange_data_provider_mac.h" 16 #include "ui/base/dragdrop/os_exchange_data_provider_mac.h"
16 #include "ui/base/ime/input_method.h" 17 #include "ui/base/ime/input_method.h"
17 #include "ui/base/ime/text_edit_commands.h" 18 #include "ui/base/ime/text_edit_commands.h"
18 #include "ui/base/ime/text_input_client.h" 19 #include "ui/base/ime/text_input_client.h"
19 #include "ui/compositor/canvas_painter.h" 20 #include "ui/compositor/canvas_painter.h"
20 #import "ui/events/cocoa/cocoa_event_utils.h" 21 #import "ui/events/cocoa/cocoa_event_utils.h"
21 #include "ui/events/event_utils.h" 22 #include "ui/events/event_utils.h"
22 #include "ui/events/keycodes/dom/dom_code.h" 23 #include "ui/events/keycodes/dom/dom_code.h"
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after
611 612
612 ui::MouseEvent event(theEvent); 613 ui::MouseEvent event(theEvent);
613 614
614 // Aura updates tooltips with the help of aura::Window::AddPreTargetHandler(). 615 // Aura updates tooltips with the help of aura::Window::AddPreTargetHandler().
615 // Mac hooks in here. 616 // Mac hooks in here.
616 [self updateTooltipIfRequiredAt:event.location()]; 617 [self updateTooltipIfRequiredAt:event.location()];
617 618
618 hostedView_->GetWidget()->OnMouseEvent(&event); 619 hostedView_->GetWidget()->OnMouseEvent(&event);
619 } 620 }
620 621
622 - (void)forceTouchEvent:(NSEvent*)theEvent {
623 if (ui::ForceClickInvokesQuickLook())
624 [self quickLookWithEvent:theEvent];
625 }
626
621 // NSView implementation. 627 // NSView implementation.
622 628
623 - (BOOL)acceptsFirstResponder { 629 - (BOOL)acceptsFirstResponder {
624 return YES; 630 return YES;
625 } 631 }
626 632
627 - (BOOL)becomeFirstResponder { 633 - (BOOL)becomeFirstResponder {
628 BOOL result = [super becomeFirstResponder]; 634 BOOL result = [super becomeFirstResponder];
629 if (result && hostedView_) 635 if (result && hostedView_)
630 hostedView_->GetWidget()->GetFocusManager()->RestoreFocusedView(); 636 hostedView_->GetWidget()->GetFocusManager()->RestoreFocusedView();
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
1470 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point]; 1476 return [hostedView_->GetNativeViewAccessible() accessibilityHitTest:point];
1471 } 1477 }
1472 1478
1473 - (id)accessibilityFocusedUIElement { 1479 - (id)accessibilityFocusedUIElement {
1474 if (!hostedView_) 1480 if (!hostedView_)
1475 return nil; 1481 return nil;
1476 return [hostedView_->GetNativeViewAccessible() accessibilityFocusedUIElement]; 1482 return [hostedView_->GetNativeViewAccessible() accessibilityFocusedUIElement];
1477 } 1483 }
1478 1484
1479 @end 1485 @end
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698