OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/browser/renderer_host/render_widget_host_view_mac.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_mac.h" |
6 | 6 |
7 #import <objc/runtime.h> | 7 #import <objc/runtime.h> |
8 #include <OpenGL/gl.h> | 8 #include <OpenGL/gl.h> |
9 #include <QuartzCore/QuartzCore.h> | 9 #include <QuartzCore/QuartzCore.h> |
10 | 10 |
(...skipping 2253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2264 } | 2264 } |
2265 | 2265 |
2266 - (void)touchesCancelledWithEvent:(NSEvent*)event { | 2266 - (void)touchesCancelledWithEvent:(NSEvent*)event { |
2267 [responderDelegate_ touchesCancelledWithEvent:event]; | 2267 [responderDelegate_ touchesCancelledWithEvent:event]; |
2268 } | 2268 } |
2269 | 2269 |
2270 - (void)touchesEndedWithEvent:(NSEvent*)event { | 2270 - (void)touchesEndedWithEvent:(NSEvent*)event { |
2271 [responderDelegate_ touchesEndedWithEvent:event]; | 2271 [responderDelegate_ touchesEndedWithEvent:event]; |
2272 } | 2272 } |
2273 | 2273 |
2274 - (void)smartMagnifyWithEvent:(NSEvent*)event { | |
2275 const WebGestureEvent& smartMagnifyEvent = | |
2276 WebInputEventFactory::gestureEvent(event, self); | |
2277 renderWidgetHostView_->render_widget_host_->ForwardGestureEvent( | |
2278 smartMagnifyEvent); | |
2279 } | |
2280 | |
2281 // This is invoked only on 10.8 or newer when the user taps a word using | 2274 // This is invoked only on 10.8 or newer when the user taps a word using |
2282 // three fingers. | 2275 // three fingers. |
2283 - (void)quickLookWithEvent:(NSEvent*)event { | 2276 - (void)quickLookWithEvent:(NSEvent*)event { |
2284 NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil]; | 2277 NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil]; |
2285 TextInputClientMac::GetInstance()->GetStringAtPoint( | 2278 TextInputClientMac::GetInstance()->GetStringAtPoint( |
2286 renderWidgetHostView_->render_widget_host_, | 2279 renderWidgetHostView_->render_widget_host_, |
2287 gfx::Point(point.x, NSHeight([self frame]) - point.y), | 2280 gfx::Point(point.x, NSHeight([self frame]) - point.y), |
2288 ^(NSAttributedString* string, NSPoint baselinePoint) { | 2281 ^(NSAttributedString* string, NSPoint baselinePoint) { |
2289 if (string && [string length] > 0) { | 2282 if (string && [string length] > 0) { |
2290 dispatch_async(dispatch_get_main_queue(), ^{ | 2283 dispatch_async(dispatch_get_main_queue(), ^{ |
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3416 | 3409 |
3417 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3410 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
3418 // regions that are not draggable. (See ControlRegionView in | 3411 // regions that are not draggable. (See ControlRegionView in |
3419 // native_app_window_cocoa.mm). This requires the render host view to be | 3412 // native_app_window_cocoa.mm). This requires the render host view to be |
3420 // draggable by default. | 3413 // draggable by default. |
3421 - (BOOL)mouseDownCanMoveWindow { | 3414 - (BOOL)mouseDownCanMoveWindow { |
3422 return YES; | 3415 return YES; |
3423 } | 3416 } |
3424 | 3417 |
3425 @end | 3418 @end |
OLD | NEW |