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 23 matching lines...) Expand all Loading... |
34 #include "content/browser/compositor/resize_lock.h" | 34 #include "content/browser/compositor/resize_lock.h" |
35 #include "content/browser/frame_host/frame_tree.h" | 35 #include "content/browser/frame_host/frame_tree.h" |
36 #include "content/browser/frame_host/frame_tree_node.h" | 36 #include "content/browser/frame_host/frame_tree_node.h" |
37 #include "content/browser/frame_host/render_frame_host_impl.h" | 37 #include "content/browser/frame_host/render_frame_host_impl.h" |
38 #include "content/browser/gpu/compositor_util.h" | 38 #include "content/browser/gpu/compositor_util.h" |
39 #include "content/browser/renderer_host/input/web_input_event_builders_mac.h" | 39 #include "content/browser/renderer_host/input/web_input_event_builders_mac.h" |
40 #include "content/browser/renderer_host/render_view_host_impl.h" | 40 #include "content/browser/renderer_host/render_view_host_impl.h" |
41 #include "content/browser/renderer_host/render_widget_helper.h" | 41 #include "content/browser/renderer_host/render_widget_helper.h" |
42 #include "content/browser/renderer_host/render_widget_host_delegate.h" | 42 #include "content/browser/renderer_host/render_widget_host_delegate.h" |
43 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" | 43 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" |
| 44 #import "content/browser/renderer_host/input/synthetic_gesture_target_mac.h" |
44 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he
lper.h" | 45 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he
lper.h" |
45 #import "content/browser/renderer_host/render_widget_host_view_mac_editcommand_h
elper.h" | 46 #import "content/browser/renderer_host/render_widget_host_view_mac_editcommand_h
elper.h" |
46 #include "content/browser/renderer_host/render_widget_resize_helper_mac.h" | 47 #include "content/browser/renderer_host/render_widget_resize_helper_mac.h" |
47 #import "content/browser/renderer_host/text_input_client_mac.h" | 48 #import "content/browser/renderer_host/text_input_client_mac.h" |
48 #include "content/common/accessibility_messages.h" | 49 #include "content/common/accessibility_messages.h" |
49 #include "content/common/edit_command.h" | 50 #include "content/common/edit_command.h" |
50 #include "content/common/gpu/gpu_messages.h" | 51 #include "content/common/gpu/gpu_messages.h" |
51 #include "content/common/input_messages.h" | 52 #include "content/common/input_messages.h" |
52 #include "content/common/view_messages.h" | 53 #include "content/common/view_messages.h" |
53 #include "content/common/webplugin_geometry.h" | 54 #include "content/common/webplugin_geometry.h" |
(...skipping 1576 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1630 void RenderWidgetHostViewMac::WheelEventAck( | 1631 void RenderWidgetHostViewMac::WheelEventAck( |
1631 const blink::WebMouseWheelEvent& event, | 1632 const blink::WebMouseWheelEvent& event, |
1632 InputEventAckState ack_result) { | 1633 InputEventAckState ack_result) { |
1633 bool consumed = ack_result == INPUT_EVENT_ACK_STATE_CONSUMED; | 1634 bool consumed = ack_result == INPUT_EVENT_ACK_STATE_CONSUMED; |
1634 // Only record a wheel event as unhandled if JavaScript handlers got a chance | 1635 // Only record a wheel event as unhandled if JavaScript handlers got a chance |
1635 // to see it (no-op wheel events are ignored by the event dispatcher) | 1636 // to see it (no-op wheel events are ignored by the event dispatcher) |
1636 if (event.deltaX || event.deltaY) | 1637 if (event.deltaX || event.deltaY) |
1637 [cocoa_view_ processedWheelEvent:event consumed:consumed]; | 1638 [cocoa_view_ processedWheelEvent:event consumed:consumed]; |
1638 } | 1639 } |
1639 | 1640 |
| 1641 scoped_ptr<SyntheticGestureTarget> |
| 1642 RenderWidgetHostViewMac::CreateSyntheticGestureTarget() { |
| 1643 RenderWidgetHostImpl* host = |
| 1644 RenderWidgetHostImpl::From(GetRenderWidgetHost()); |
| 1645 return scoped_ptr<SyntheticGestureTarget>( |
| 1646 new SyntheticGestureTargetMac(host, cocoa_view_)); |
| 1647 } |
| 1648 |
1640 uint32_t RenderWidgetHostViewMac::GetSurfaceIdNamespace() { | 1649 uint32_t RenderWidgetHostViewMac::GetSurfaceIdNamespace() { |
1641 if (delegated_frame_host_) | 1650 if (delegated_frame_host_) |
1642 return delegated_frame_host_->GetSurfaceIdNamespace(); | 1651 return delegated_frame_host_->GetSurfaceIdNamespace(); |
1643 | 1652 |
1644 return 0; | 1653 return 0; |
1645 } | 1654 } |
1646 | 1655 |
1647 uint32_t RenderWidgetHostViewMac::SurfaceIdNamespaceAtPoint( | 1656 uint32_t RenderWidgetHostViewMac::SurfaceIdNamespaceAtPoint( |
1648 const gfx::Point& point, | 1657 const gfx::Point& point, |
1649 gfx::Point* transformed_point) { | 1658 gfx::Point* transformed_point) { |
(...skipping 1757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3407 | 3416 |
3408 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding | 3417 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding |
3409 // regions that are not draggable. (See ControlRegionView in | 3418 // regions that are not draggable. (See ControlRegionView in |
3410 // native_app_window_cocoa.mm). This requires the render host view to be | 3419 // native_app_window_cocoa.mm). This requires the render host view to be |
3411 // draggable by default. | 3420 // draggable by default. |
3412 - (BOOL)mouseDownCanMoveWindow { | 3421 - (BOOL)mouseDownCanMoveWindow { |
3413 return YES; | 3422 return YES; |
3414 } | 3423 } |
3415 | 3424 |
3416 @end | 3425 @end |
OLD | NEW |