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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 1345043003: Revert of [KeyEvent Mac] Move WebInputEventFactory into chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 months 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
OLDNEW
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 18 matching lines...) Expand all
29 #import "content/browser/accessibility/browser_accessibility_cocoa.h" 29 #import "content/browser/accessibility/browser_accessibility_cocoa.h"
30 #include "content/browser/accessibility/browser_accessibility_manager_mac.h" 30 #include "content/browser/accessibility/browser_accessibility_manager_mac.h"
31 #include "content/browser/bad_message.h" 31 #include "content/browser/bad_message.h"
32 #import "content/browser/cocoa/system_hotkey_helper_mac.h" 32 #import "content/browser/cocoa/system_hotkey_helper_mac.h"
33 #import "content/browser/cocoa/system_hotkey_map.h" 33 #import "content/browser/cocoa/system_hotkey_map.h"
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"
40 #include "content/browser/renderer_host/render_view_host_impl.h" 39 #include "content/browser/renderer_host/render_view_host_impl.h"
41 #include "content/browser/renderer_host/render_widget_helper.h" 40 #include "content/browser/renderer_host/render_widget_helper.h"
42 #include "content/browser/renderer_host/render_widget_host_delegate.h" 41 #include "content/browser/renderer_host/render_widget_host_delegate.h"
43 #include "content/browser/renderer_host/render_widget_host_input_event_router.h" 42 #include "content/browser/renderer_host/render_widget_host_input_event_router.h"
44 #import "content/browser/renderer_host/render_widget_host_view_mac_dictionary_he lper.h" 43 #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" 44 #import "content/browser/renderer_host/render_widget_host_view_mac_editcommand_h elper.h"
46 #include "content/browser/renderer_host/render_widget_resize_helper.h" 45 #include "content/browser/renderer_host/render_widget_resize_helper.h"
47 #import "content/browser/renderer_host/text_input_client_mac.h" 46 #import "content/browser/renderer_host/text_input_client_mac.h"
48 #include "content/common/accessibility_messages.h" 47 #include "content/common/accessibility_messages.h"
49 #include "content/common/edit_command.h" 48 #include "content/common/edit_command.h"
50 #include "content/common/gpu/gpu_messages.h" 49 #include "content/common/gpu/gpu_messages.h"
51 #include "content/common/input_messages.h" 50 #include "content/common/input_messages.h"
52 #include "content/common/view_messages.h" 51 #include "content/common/view_messages.h"
53 #include "content/common/webplugin_geometry.h" 52 #include "content/common/webplugin_geometry.h"
54 #include "content/public/browser/browser_context.h" 53 #include "content/public/browser/browser_context.h"
55 #include "content/public/browser/browser_plugin_guest_manager.h" 54 #include "content/public/browser/browser_plugin_guest_manager.h"
56 #include "content/public/browser/browser_thread.h" 55 #include "content/public/browser/browser_thread.h"
57 #include "content/public/browser/native_web_keyboard_event.h" 56 #include "content/public/browser/native_web_keyboard_event.h"
58 #include "content/public/browser/notification_service.h" 57 #include "content/public/browser/notification_service.h"
59 #include "content/public/browser/notification_types.h" 58 #include "content/public/browser/notification_types.h"
60 #include "content/public/browser/render_widget_host_view_frame_subscriber.h" 59 #include "content/public/browser/render_widget_host_view_frame_subscriber.h"
61 #import "content/public/browser/render_widget_host_view_mac_delegate.h" 60 #import "content/public/browser/render_widget_host_view_mac_delegate.h"
62 #include "content/public/browser/web_contents.h" 61 #include "content/public/browser/web_contents.h"
63 #include "skia/ext/platform_canvas.h" 62 #include "skia/ext/platform_canvas.h"
64 #include "skia/ext/skia_utils_mac.h" 63 #include "skia/ext/skia_utils_mac.h"
65 #include "third_party/WebKit/public/platform/WebScreenInfo.h" 64 #include "third_party/WebKit/public/platform/WebScreenInfo.h"
66 #include "third_party/WebKit/public/web/WebInputEvent.h" 65 #include "third_party/WebKit/public/web/WebInputEvent.h"
66 #include "third_party/WebKit/public/web/mac/WebInputEventFactory.h"
67 #import "third_party/mozilla/ComplexTextInputPanel.h" 67 #import "third_party/mozilla/ComplexTextInputPanel.h"
68 #include "ui/accelerated_widget_mac/io_surface_layer.h" 68 #include "ui/accelerated_widget_mac/io_surface_layer.h"
69 #include "ui/accelerated_widget_mac/surface_handle_types.h" 69 #include "ui/accelerated_widget_mac/surface_handle_types.h"
70 #include "ui/base/cocoa/animation_utils.h" 70 #include "ui/base/cocoa/animation_utils.h"
71 #import "ui/base/cocoa/fullscreen_window_manager.h" 71 #import "ui/base/cocoa/fullscreen_window_manager.h"
72 #import "ui/base/cocoa/underlay_opengl_hosting_window.h" 72 #import "ui/base/cocoa/underlay_opengl_hosting_window.h"
73 #include "ui/base/layout.h" 73 #include "ui/base/layout.h"
74 #include "ui/compositor/compositor.h" 74 #include "ui/compositor/compositor.h"
75 #include "ui/compositor/layer.h" 75 #include "ui/compositor/layer.h"
76 #include "ui/events/keycodes/keyboard_codes.h" 76 #include "ui/events/keycodes/keyboard_codes.h"
(...skipping 13 matching lines...) Expand all
90 using content::FrameTreeNode; 90 using content::FrameTreeNode;
91 using content::NativeWebKeyboardEvent; 91 using content::NativeWebKeyboardEvent;
92 using content::RenderFrameHost; 92 using content::RenderFrameHost;
93 using content::RenderViewHost; 93 using content::RenderViewHost;
94 using content::RenderViewHostImpl; 94 using content::RenderViewHostImpl;
95 using content::RenderWidgetHostImpl; 95 using content::RenderWidgetHostImpl;
96 using content::RenderWidgetHostViewMac; 96 using content::RenderWidgetHostViewMac;
97 using content::RenderWidgetHostViewMacEditCommandHelper; 97 using content::RenderWidgetHostViewMacEditCommandHelper;
98 using content::TextInputClientMac; 98 using content::TextInputClientMac;
99 using content::WebContents; 99 using content::WebContents;
100 using content::WebGestureEventBuilder;
101 using content::WebMouseEventBuilder;
102 using content::WebMouseWheelEventBuilder;
103 using blink::WebInputEvent; 100 using blink::WebInputEvent;
101 using blink::WebInputEventFactory;
104 using blink::WebMouseEvent; 102 using blink::WebMouseEvent;
105 using blink::WebMouseWheelEvent; 103 using blink::WebMouseWheelEvent;
106 using blink::WebGestureEvent; 104 using blink::WebGestureEvent;
107 105
108 namespace { 106 namespace {
109 107
110 // Whether a keyboard event has been reserved by OSX. 108 // Whether a keyboard event has been reserved by OSX.
111 BOOL EventIsReservedBySystem(NSEvent* event) { 109 BOOL EventIsReservedBySystem(NSEvent* event) {
112 content::SystemHotkeyHelperMac* helper = 110 content::SystemHotkeyHelperMac* helper =
113 content::SystemHotkeyHelperMac::GetInstance(); 111 content::SystemHotkeyHelperMac::GetInstance();
(...skipping 1168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1282 NSPoint location = [window mouseLocationOutsideOfEventStream]; 1280 NSPoint location = [window mouseLocationOutsideOfEventStream];
1283 NSEvent* event = [NSEvent mouseEventWithType:NSMouseMoved 1281 NSEvent* event = [NSEvent mouseEventWithType:NSMouseMoved
1284 location:location 1282 location:location
1285 modifierFlags:0 1283 modifierFlags:0
1286 timestamp:0 1284 timestamp:0
1287 windowNumber:window_number() 1285 windowNumber:window_number()
1288 context:nil 1286 context:nil
1289 eventNumber:0 1287 eventNumber:0
1290 clickCount:0 1288 clickCount:0
1291 pressure:0]; 1289 pressure:0];
1292 WebMouseEvent web_event = WebMouseEventBuilder::Build(event, cocoa_view_); 1290 WebMouseEvent web_event =
1291 WebInputEventFactory::mouseEvent(event, cocoa_view_);
1293 if (showing) 1292 if (showing)
1294 web_event.type = WebInputEvent::MouseLeave; 1293 web_event.type = WebInputEvent::MouseLeave;
1295 ForwardMouseEvent(web_event); 1294 ForwardMouseEvent(web_event);
1296 } 1295 }
1297 1296
1298 bool RenderWidgetHostViewMac::IsPopup() const { 1297 bool RenderWidgetHostViewMac::IsPopup() const {
1299 return popup_type_ != blink::WebPopupTypeNone; 1298 return popup_type_ != blink::WebPopupTypeNone;
1300 } 1299 }
1301 1300
1302 void RenderWidgetHostViewMac::CopyFromCompositingSurface( 1301 void RenderWidgetHostViewMac::CopyFromCompositingSurface(
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1971 if (responderDelegate_ && 1970 if (responderDelegate_ &&
1972 [responderDelegate_ respondsToSelector:@selector(handleEvent:)]) { 1971 [responderDelegate_ respondsToSelector:@selector(handleEvent:)]) {
1973 BOOL handled = [responderDelegate_ handleEvent:theEvent]; 1972 BOOL handled = [responderDelegate_ handleEvent:theEvent];
1974 if (handled) 1973 if (handled)
1975 return; 1974 return;
1976 } 1975 }
1977 1976
1978 if ([self shouldIgnoreMouseEvent:theEvent]) { 1977 if ([self shouldIgnoreMouseEvent:theEvent]) {
1979 // If this is the first such event, send a mouse exit to the host view. 1978 // If this is the first such event, send a mouse exit to the host view.
1980 if (!mouseEventWasIgnored_ && renderWidgetHostView_->render_widget_host_) { 1979 if (!mouseEventWasIgnored_ && renderWidgetHostView_->render_widget_host_) {
1981 WebMouseEvent exitEvent = WebMouseEventBuilder::Build(theEvent, self); 1980 WebMouseEvent exitEvent =
1981 WebInputEventFactory::mouseEvent(theEvent, self);
1982 exitEvent.type = WebInputEvent::MouseLeave; 1982 exitEvent.type = WebInputEvent::MouseLeave;
1983 exitEvent.button = WebMouseEvent::ButtonNone; 1983 exitEvent.button = WebMouseEvent::ButtonNone;
1984 renderWidgetHostView_->ForwardMouseEvent(exitEvent); 1984 renderWidgetHostView_->ForwardMouseEvent(exitEvent);
1985 } 1985 }
1986 mouseEventWasIgnored_ = YES; 1986 mouseEventWasIgnored_ = YES;
1987 return; 1987 return;
1988 } 1988 }
1989 1989
1990 if (mouseEventWasIgnored_) { 1990 if (mouseEventWasIgnored_) {
1991 // If this is the first mouse event after a previous event that was ignored 1991 // If this is the first mouse event after a previous event that was ignored
1992 // due to the hitTest, send a mouse enter event to the host view. 1992 // due to the hitTest, send a mouse enter event to the host view.
1993 if (renderWidgetHostView_->render_widget_host_) { 1993 if (renderWidgetHostView_->render_widget_host_) {
1994 WebMouseEvent enterEvent = WebMouseEventBuilder::Build(theEvent, self); 1994 WebMouseEvent enterEvent =
1995 WebInputEventFactory::mouseEvent(theEvent, self);
1995 enterEvent.type = WebInputEvent::MouseMove; 1996 enterEvent.type = WebInputEvent::MouseMove;
1996 enterEvent.button = WebMouseEvent::ButtonNone; 1997 enterEvent.button = WebMouseEvent::ButtonNone;
1997 if (renderWidgetHostView_->render_widget_host_->delegate() && 1998 if (renderWidgetHostView_->render_widget_host_->delegate() &&
1998 renderWidgetHostView_->render_widget_host_->delegate() 1999 renderWidgetHostView_->render_widget_host_->delegate()
1999 ->GetInputEventRouter()) { 2000 ->GetInputEventRouter()) {
2000 renderWidgetHostView_->render_widget_host_->delegate() 2001 renderWidgetHostView_->render_widget_host_->delegate()
2001 ->GetInputEventRouter() 2002 ->GetInputEventRouter()
2002 ->RouteMouseEvent(renderWidgetHostView_.get(), &enterEvent); 2003 ->RouteMouseEvent(renderWidgetHostView_.get(), &enterEvent);
2003 } else { 2004 } else {
2004 renderWidgetHostView_->ForwardMouseEvent(enterEvent); 2005 renderWidgetHostView_->ForwardMouseEvent(enterEvent);
(...skipping 18 matching lines...) Expand all
2023 // wants to handle them. But it won't work without implementing method 2024 // wants to handle them. But it won't work without implementing method
2024 // - (NSUInteger)characterIndexForPoint:. 2025 // - (NSUInteger)characterIndexForPoint:.
2025 // See: http://code.google.com/p/chromium/issues/detail?id=47141 2026 // See: http://code.google.com/p/chromium/issues/detail?id=47141
2026 // Instead of sending mouse events to the input method first, we now just 2027 // Instead of sending mouse events to the input method first, we now just
2027 // simply confirm all ongoing composition here. 2028 // simply confirm all ongoing composition here.
2028 if (type == NSLeftMouseDown || type == NSRightMouseDown || 2029 if (type == NSLeftMouseDown || type == NSRightMouseDown ||
2029 type == NSOtherMouseDown) { 2030 type == NSOtherMouseDown) {
2030 [self confirmComposition]; 2031 [self confirmComposition];
2031 } 2032 }
2032 2033
2033 WebMouseEvent event = WebMouseEventBuilder::Build(theEvent, self); 2034 WebMouseEvent event = WebInputEventFactory::mouseEvent(theEvent, self);
2034 if (renderWidgetHostView_->render_widget_host_->delegate() && 2035 if (renderWidgetHostView_->render_widget_host_->delegate() &&
2035 renderWidgetHostView_->render_widget_host_->delegate() 2036 renderWidgetHostView_->render_widget_host_->delegate()
2036 ->GetInputEventRouter()) { 2037 ->GetInputEventRouter()) {
2037 renderWidgetHostView_->render_widget_host_->delegate() 2038 renderWidgetHostView_->render_widget_host_->delegate()
2038 ->GetInputEventRouter() 2039 ->GetInputEventRouter()
2039 ->RouteMouseEvent(renderWidgetHostView_.get(), &event); 2040 ->RouteMouseEvent(renderWidgetHostView_.get(), &event);
2040 } else { 2041 } else {
2041 renderWidgetHostView_->ForwardMouseEvent(event); 2042 renderWidgetHostView_->ForwardMouseEvent(event);
2042 } 2043 }
2043 } 2044 }
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after
2356 if ([event phase] != NSEventPhaseEnded && 2357 if ([event phase] != NSEventPhaseEnded &&
2357 [event phase] != NSEventPhaseCancelled) { 2358 [event phase] != NSEventPhaseCancelled) {
2358 return; 2359 return;
2359 } 2360 }
2360 2361
2361 if (renderWidgetHostView_->render_widget_host_) { 2362 if (renderWidgetHostView_->render_widget_host_) {
2362 // History-swiping is not possible if the logic reaches this point. 2363 // History-swiping is not possible if the logic reaches this point.
2363 // Allow rubber-banding in both directions. 2364 // Allow rubber-banding in both directions.
2364 bool canRubberbandLeft = true; 2365 bool canRubberbandLeft = true;
2365 bool canRubberbandRight = true; 2366 bool canRubberbandRight = true;
2366 WebMouseWheelEvent webEvent = WebMouseWheelEventBuilder::Build( 2367 WebMouseWheelEvent webEvent = WebInputEventFactory::mouseWheelEvent(
2367 event, self, canRubberbandLeft, canRubberbandRight); 2368 event, self, canRubberbandLeft, canRubberbandRight);
2368 webEvent.railsMode = mouseWheelFilter_.UpdateRailsMode(webEvent); 2369 webEvent.railsMode = mouseWheelFilter_.UpdateRailsMode(webEvent);
2369 renderWidgetHostView_->render_widget_host_->ForwardWheelEvent(webEvent); 2370 renderWidgetHostView_->render_widget_host_->ForwardWheelEvent(webEvent);
2370 } 2371 }
2371 2372
2372 if (endWheelMonitor_) { 2373 if (endWheelMonitor_) {
2373 [NSEvent removeMonitor:endWheelMonitor_]; 2374 [NSEvent removeMonitor:endWheelMonitor_];
2374 endWheelMonitor_ = nil; 2375 endWheelMonitor_ = nil;
2375 } 2376 }
2376 } 2377 }
2377 2378
2378 - (void)beginGestureWithEvent:(NSEvent*)event { 2379 - (void)beginGestureWithEvent:(NSEvent*)event {
2379 [responderDelegate_ beginGestureWithEvent:event]; 2380 [responderDelegate_ beginGestureWithEvent:event];
2380 gestureBeginEvent_.reset( 2381 gestureBeginEvent_.reset(
2381 new WebGestureEvent(WebGestureEventBuilder::Build(event, self))); 2382 new WebGestureEvent(WebInputEventFactory::gestureEvent(event, self)));
2382 2383
2383 // If the page is at the minimum zoom level, require a threshold be reached 2384 // If the page is at the minimum zoom level, require a threshold be reached
2384 // before the pinch has an effect. 2385 // before the pinch has an effect.
2385 if (renderWidgetHostView_->page_at_minimum_scale_) { 2386 if (renderWidgetHostView_->page_at_minimum_scale_) {
2386 pinchHasReachedZoomThreshold_ = false; 2387 pinchHasReachedZoomThreshold_ = false;
2387 pinchUnusedAmount_ = 1; 2388 pinchUnusedAmount_ = 1;
2388 } 2389 }
2389 } 2390 }
2390 2391
2391 - (void)endGestureWithEvent:(NSEvent*)event { 2392 - (void)endGestureWithEvent:(NSEvent*)event {
2392 [responderDelegate_ endGestureWithEvent:event]; 2393 [responderDelegate_ endGestureWithEvent:event];
2393 gestureBeginEvent_.reset(); 2394 gestureBeginEvent_.reset();
2394 2395
2395 if (!renderWidgetHostView_->render_widget_host_) 2396 if (!renderWidgetHostView_->render_widget_host_)
2396 return; 2397 return;
2397 2398
2398 if (gestureBeginPinchSent_) { 2399 if (gestureBeginPinchSent_) {
2399 WebGestureEvent endEvent(WebGestureEventBuilder::Build(event, self)); 2400 WebGestureEvent endEvent(WebInputEventFactory::gestureEvent(event, self));
2400 endEvent.type = WebInputEvent::GesturePinchEnd; 2401 endEvent.type = WebInputEvent::GesturePinchEnd;
2401 renderWidgetHostView_->render_widget_host_->ForwardGestureEvent(endEvent); 2402 renderWidgetHostView_->render_widget_host_->ForwardGestureEvent(endEvent);
2402 gestureBeginPinchSent_ = NO; 2403 gestureBeginPinchSent_ = NO;
2403 } 2404 }
2404 } 2405 }
2405 2406
2406 - (void)touchesMovedWithEvent:(NSEvent*)event { 2407 - (void)touchesMovedWithEvent:(NSEvent*)event {
2407 [responderDelegate_ touchesMovedWithEvent:event]; 2408 [responderDelegate_ touchesMovedWithEvent:event];
2408 } 2409 }
2409 2410
2410 - (void)touchesBeganWithEvent:(NSEvent*)event { 2411 - (void)touchesBeganWithEvent:(NSEvent*)event {
2411 [responderDelegate_ touchesBeganWithEvent:event]; 2412 [responderDelegate_ touchesBeganWithEvent:event];
2412 } 2413 }
2413 2414
2414 - (void)touchesCancelledWithEvent:(NSEvent*)event { 2415 - (void)touchesCancelledWithEvent:(NSEvent*)event {
2415 [responderDelegate_ touchesCancelledWithEvent:event]; 2416 [responderDelegate_ touchesCancelledWithEvent:event];
2416 } 2417 }
2417 2418
2418 - (void)touchesEndedWithEvent:(NSEvent*)event { 2419 - (void)touchesEndedWithEvent:(NSEvent*)event {
2419 [responderDelegate_ touchesEndedWithEvent:event]; 2420 [responderDelegate_ touchesEndedWithEvent:event];
2420 } 2421 }
2421 2422
2422 - (void)smartMagnifyWithEvent:(NSEvent*)event { 2423 - (void)smartMagnifyWithEvent:(NSEvent*)event {
2423 const WebGestureEvent& smartMagnifyEvent = 2424 const WebGestureEvent& smartMagnifyEvent =
2424 WebGestureEventBuilder::Build(event, self); 2425 WebInputEventFactory::gestureEvent(event, self);
2425 if (renderWidgetHostView_ && renderWidgetHostView_->render_widget_host_) { 2426 if (renderWidgetHostView_ && renderWidgetHostView_->render_widget_host_) {
2426 renderWidgetHostView_->render_widget_host_->ForwardGestureEvent( 2427 renderWidgetHostView_->render_widget_host_->ForwardGestureEvent(
2427 smartMagnifyEvent); 2428 smartMagnifyEvent);
2428 } 2429 }
2429 } 2430 }
2430 2431
2431 // This is invoked only on 10.8 or newer when the user taps a word using 2432 // This is invoked only on 10.8 or newer when the user taps a word using
2432 // three fingers. 2433 // three fingers.
2433 - (void)quickLookWithEvent:(NSEvent*)event { 2434 - (void)quickLookWithEvent:(NSEvent*)event {
2434 NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil]; 2435 NSPoint point = [self convertPoint:[event locationInWindow] fromView:nil];
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
2487 handler:^(NSEvent* blockEvent) { 2488 handler:^(NSEvent* blockEvent) {
2488 [self shortCircuitScrollWheelEvent:blockEvent]; 2489 [self shortCircuitScrollWheelEvent:blockEvent];
2489 return blockEvent; 2490 return blockEvent;
2490 }]; 2491 }];
2491 } 2492 }
2492 2493
2493 // This is responsible for content scrolling! 2494 // This is responsible for content scrolling!
2494 if (renderWidgetHostView_->render_widget_host_) { 2495 if (renderWidgetHostView_->render_widget_host_) {
2495 BOOL canRubberbandLeft = [responderDelegate_ canRubberbandLeft:self]; 2496 BOOL canRubberbandLeft = [responderDelegate_ canRubberbandLeft:self];
2496 BOOL canRubberbandRight = [responderDelegate_ canRubberbandRight:self]; 2497 BOOL canRubberbandRight = [responderDelegate_ canRubberbandRight:self];
2497 WebMouseWheelEvent webEvent = WebMouseWheelEventBuilder::Build( 2498 WebMouseWheelEvent webEvent = WebInputEventFactory::mouseWheelEvent(
2498 event, self, canRubberbandLeft, canRubberbandRight); 2499 event, self, canRubberbandLeft, canRubberbandRight);
2499 webEvent.railsMode = mouseWheelFilter_.UpdateRailsMode(webEvent); 2500 webEvent.railsMode = mouseWheelFilter_.UpdateRailsMode(webEvent);
2500 if (renderWidgetHostView_->render_widget_host_->delegate() && 2501 if (renderWidgetHostView_->render_widget_host_->delegate() &&
2501 renderWidgetHostView_->render_widget_host_->delegate() 2502 renderWidgetHostView_->render_widget_host_->delegate()
2502 ->GetInputEventRouter()) { 2503 ->GetInputEventRouter()) {
2503 renderWidgetHostView_->render_widget_host_->delegate() 2504 renderWidgetHostView_->render_widget_host_->delegate()
2504 ->GetInputEventRouter() 2505 ->GetInputEventRouter()
2505 ->RouteMouseWheelEvent(renderWidgetHostView_.get(), &webEvent); 2506 ->RouteMouseWheelEvent(renderWidgetHostView_.get(), &webEvent);
2506 } else { 2507 } else {
2507 renderWidgetHostView_->render_widget_host_->ForwardWheelEvent(webEvent); 2508 renderWidgetHostView_->render_widget_host_->ForwardWheelEvent(webEvent);
(...skipping 20 matching lines...) Expand all
2528 2529
2529 // Send a GesturePinchBegin event if none has been sent yet. 2530 // Send a GesturePinchBegin event if none has been sent yet.
2530 if (!gestureBeginPinchSent_) { 2531 if (!gestureBeginPinchSent_) {
2531 WebGestureEvent beginEvent(*gestureBeginEvent_); 2532 WebGestureEvent beginEvent(*gestureBeginEvent_);
2532 beginEvent.type = WebInputEvent::GesturePinchBegin; 2533 beginEvent.type = WebInputEvent::GesturePinchBegin;
2533 renderWidgetHostView_->render_widget_host_->ForwardGestureEvent(beginEvent); 2534 renderWidgetHostView_->render_widget_host_->ForwardGestureEvent(beginEvent);
2534 gestureBeginPinchSent_ = YES; 2535 gestureBeginPinchSent_ = YES;
2535 } 2536 }
2536 2537
2537 // Send a GesturePinchUpdate event. 2538 // Send a GesturePinchUpdate event.
2538 WebGestureEvent updateEvent = WebGestureEventBuilder::Build(event, self); 2539 WebGestureEvent updateEvent =
2540 WebInputEventFactory::gestureEvent(event, self);
2539 updateEvent.data.pinchUpdate.zoomDisabled = !pinchHasReachedZoomThreshold_; 2541 updateEvent.data.pinchUpdate.zoomDisabled = !pinchHasReachedZoomThreshold_;
2540 renderWidgetHostView_->render_widget_host_->ForwardGestureEvent(updateEvent); 2542 renderWidgetHostView_->render_widget_host_->ForwardGestureEvent(updateEvent);
2541 } 2543 }
2542 2544
2543 - (void)viewWillMoveToWindow:(NSWindow*)newWindow { 2545 - (void)viewWillMoveToWindow:(NSWindow*)newWindow {
2544 NSWindow* oldWindow = [self window]; 2546 NSWindow* oldWindow = [self window];
2545 2547
2546 NSNotificationCenter* notificationCenter = 2548 NSNotificationCenter* notificationCenter =
2547 [NSNotificationCenter defaultCenter]; 2549 [NSNotificationCenter defaultCenter];
2548 2550
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after
3403 3405
3404 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding 3406 // "-webkit-app-region: drag | no-drag" is implemented on Mac by excluding
3405 // regions that are not draggable. (See ControlRegionView in 3407 // regions that are not draggable. (See ControlRegionView in
3406 // native_app_window_cocoa.mm). This requires the render host view to be 3408 // native_app_window_cocoa.mm). This requires the render host view to be
3407 // draggable by default. 3409 // draggable by default.
3408 - (BOOL)mouseDownCanMoveWindow { 3410 - (BOOL)mouseDownCanMoveWindow {
3409 return YES; 3411 return YES;
3410 } 3412 }
3411 3413
3412 @end 3414 @end
OLDNEW
« no previous file with comments | « content/browser/renderer_host/native_web_keyboard_event_mac.mm ('k') | content/browser/renderer_host/web_input_event_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698