| 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 #include <stdint.h> | 10 #include <stdint.h> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" | 65 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" |
| 66 #import "content/public/browser/render_widget_host_view_mac_delegate.h" | 66 #import "content/public/browser/render_widget_host_view_mac_delegate.h" |
| 67 #include "content/public/browser/web_contents.h" | 67 #include "content/public/browser/web_contents.h" |
| 68 #include "gpu/ipc/common/gpu_messages.h" | 68 #include "gpu/ipc/common/gpu_messages.h" |
| 69 #include "skia/ext/platform_canvas.h" | 69 #include "skia/ext/platform_canvas.h" |
| 70 #include "skia/ext/skia_utils_mac.h" | 70 #include "skia/ext/skia_utils_mac.h" |
| 71 #include "third_party/WebKit/public/platform/WebScreenInfo.h" | 71 #include "third_party/WebKit/public/platform/WebScreenInfo.h" |
| 72 #include "third_party/WebKit/public/web/WebInputEvent.h" | 72 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 73 #import "ui/base/clipboard/clipboard_util_mac.h" | 73 #import "ui/base/clipboard/clipboard_util_mac.h" |
| 74 #include "ui/base/cocoa/animation_utils.h" | 74 #include "ui/base/cocoa/animation_utils.h" |
| 75 #import "ui/base/cocoa/appkit_utils.h" |
| 75 #include "ui/base/cocoa/cocoa_base_utils.h" | 76 #include "ui/base/cocoa/cocoa_base_utils.h" |
| 76 #import "ui/base/cocoa/fullscreen_window_manager.h" | 77 #import "ui/base/cocoa/fullscreen_window_manager.h" |
| 77 #import "ui/base/cocoa/underlay_opengl_hosting_window.h" | 78 #import "ui/base/cocoa/underlay_opengl_hosting_window.h" |
| 78 #include "ui/base/layout.h" | 79 #include "ui/base/layout.h" |
| 79 #include "ui/compositor/compositor.h" | 80 #include "ui/compositor/compositor.h" |
| 80 #include "ui/compositor/layer.h" | 81 #include "ui/compositor/layer.h" |
| 81 #include "ui/events/keycodes/keyboard_codes.h" | 82 #include "ui/events/keycodes/keyboard_codes.h" |
| 82 #include "ui/gfx/color_profile.h" | 83 #include "ui/gfx/color_profile.h" |
| 83 #include "ui/gfx/display.h" | 84 #include "ui/gfx/display.h" |
| 84 #include "ui/gfx/geometry/dip_util.h" | 85 #include "ui/gfx/geometry/dip_util.h" |
| (...skipping 2220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2305 widgetHost->ForwardKeyboardEvent(event); | 2306 widgetHost->ForwardKeyboardEvent(event); |
| 2306 } | 2307 } |
| 2307 } | 2308 } |
| 2308 | 2309 |
| 2309 // Possibly autohide the cursor. | 2310 // Possibly autohide the cursor. |
| 2310 if ([RenderWidgetHostViewCocoa shouldAutohideCursorForEvent:theEvent]) | 2311 if ([RenderWidgetHostViewCocoa shouldAutohideCursorForEvent:theEvent]) |
| 2311 [NSCursor setHiddenUntilMouseMoves:YES]; | 2312 [NSCursor setHiddenUntilMouseMoves:YES]; |
| 2312 } | 2313 } |
| 2313 | 2314 |
| 2314 - (void)forceTouchEvent:(NSEvent*)theEvent { | 2315 - (void)forceTouchEvent:(NSEvent*)theEvent { |
| 2315 [self quickLookWithEvent:theEvent]; | 2316 if (ui::ForceClickInvokesQuickLook()) |
| 2317 [self quickLookWithEvent:theEvent]; |
| 2316 } | 2318 } |
| 2317 | 2319 |
| 2318 - (void)shortCircuitScrollWheelEvent:(NSEvent*)event { | 2320 - (void)shortCircuitScrollWheelEvent:(NSEvent*)event { |
| 2319 DCHECK(base::mac::IsOSLionOrLater()); | 2321 DCHECK(base::mac::IsOSLionOrLater()); |
| 2320 | 2322 |
| 2321 if ([event phase] != NSEventPhaseEnded && | 2323 if ([event phase] != NSEventPhaseEnded && |
| 2322 [event phase] != NSEventPhaseCancelled) { | 2324 [event phase] != NSEventPhaseCancelled) { |
| 2323 return; | 2325 return; |
| 2324 } | 2326 } |
| 2325 | 2327 |
| (...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3404 | 3406 |
| 3405 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3407 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
| 3406 // regions that are not draggable. (See ControlRegionView in | 3408 // regions that are not draggable. (See ControlRegionView in |
| 3407 // native_app_window_cocoa.mm). This requires the render host view to be | 3409 // native_app_window_cocoa.mm). This requires the render host view to be |
| 3408 // draggable by default. | 3410 // draggable by default. |
| 3409 - (BOOL)mouseDownCanMoveWindow { | 3411 - (BOOL)mouseDownCanMoveWindow { |
| 3410 return YES; | 3412 return YES; |
| 3411 } | 3413 } |
| 3412 | 3414 |
| 3413 @end | 3415 @end |
| OLD | NEW |