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

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 1348843002: 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index 76fa6edc4bcd88e8fdd2524afb6056e4920b1b9c..df4cade6a9f985f7d296cc392c7a31c3be86e90b 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -36,7 +36,6 @@
#include "content/browser/frame_host/frame_tree_node.h"
#include "content/browser/frame_host/render_frame_host_impl.h"
#include "content/browser/gpu/compositor_util.h"
-#include "content/browser/renderer_host/input/web_input_event_builders_mac.h"
#include "content/browser/renderer_host/render_view_host_impl.h"
#include "content/browser/renderer_host/render_widget_helper.h"
#include "content/browser/renderer_host/render_widget_host_delegate.h"
@@ -64,6 +63,7 @@
#include "skia/ext/skia_utils_mac.h"
#include "third_party/WebKit/public/platform/WebScreenInfo.h"
#include "third_party/WebKit/public/web/WebInputEvent.h"
+#include "third_party/WebKit/public/web/mac/WebInputEventFactory.h"
#import "third_party/mozilla/ComplexTextInputPanel.h"
#include "ui/accelerated_widget_mac/io_surface_layer.h"
#include "ui/accelerated_widget_mac/surface_handle_types.h"
@@ -97,10 +97,8 @@
using content::RenderWidgetHostViewMacEditCommandHelper;
using content::TextInputClientMac;
using content::WebContents;
-using content::WebGestureEventBuilder;
-using content::WebMouseEventBuilder;
-using content::WebMouseWheelEventBuilder;
using blink::WebInputEvent;
+using blink::WebInputEventFactory;
using blink::WebMouseEvent;
using blink::WebMouseWheelEvent;
using blink::WebGestureEvent;
@@ -1288,7 +1286,8 @@
eventNumber:0
clickCount:0
pressure:0];
- WebMouseEvent web_event = WebMouseEventBuilder::Build(event, cocoa_view_);
+ WebMouseEvent web_event =
+ WebInputEventFactory::mouseEvent(event, cocoa_view_);
if (showing)
web_event.type = WebInputEvent::MouseLeave;
ForwardMouseEvent(web_event);
@@ -1982,7 +1981,8 @@
if ([self shouldIgnoreMouseEvent:theEvent]) {
// If this is the first such event, send a mouse exit to the host view.
if (!mouseEventWasIgnored_ && renderWidgetHostView_->render_widget_host_) {
- WebMouseEvent exitEvent = WebMouseEventBuilder::Build(theEvent, self);
+ WebMouseEvent exitEvent =
+ WebInputEventFactory::mouseEvent(theEvent, self);
exitEvent.type = WebInputEvent::MouseLeave;
exitEvent.button = WebMouseEvent::ButtonNone;
renderWidgetHostView_->ForwardMouseEvent(exitEvent);
@@ -1995,7 +1995,8 @@
// If this is the first mouse event after a previous event that was ignored
// due to the hitTest, send a mouse enter event to the host view.
if (renderWidgetHostView_->render_widget_host_) {
- WebMouseEvent enterEvent = WebMouseEventBuilder::Build(theEvent, self);
+ WebMouseEvent enterEvent =
+ WebInputEventFactory::mouseEvent(theEvent, self);
enterEvent.type = WebInputEvent::MouseMove;
enterEvent.button = WebMouseEvent::ButtonNone;
if (renderWidgetHostView_->render_widget_host_->delegate() &&
@@ -2034,7 +2035,7 @@
[self confirmComposition];
}
- WebMouseEvent event = WebMouseEventBuilder::Build(theEvent, self);
+ WebMouseEvent event = WebInputEventFactory::mouseEvent(theEvent, self);
if (renderWidgetHostView_->render_widget_host_->delegate() &&
renderWidgetHostView_->render_widget_host_->delegate()
->GetInputEventRouter()) {
@@ -2367,7 +2368,7 @@
// Allow rubber-banding in both directions.
bool canRubberbandLeft = true;
bool canRubberbandRight = true;
- WebMouseWheelEvent webEvent = WebMouseWheelEventBuilder::Build(
+ WebMouseWheelEvent webEvent = WebInputEventFactory::mouseWheelEvent(
event, self, canRubberbandLeft, canRubberbandRight);
webEvent.railsMode = mouseWheelFilter_.UpdateRailsMode(webEvent);
renderWidgetHostView_->render_widget_host_->ForwardWheelEvent(webEvent);
@@ -2382,7 +2383,7 @@
- (void)beginGestureWithEvent:(NSEvent*)event {
[responderDelegate_ beginGestureWithEvent:event];
gestureBeginEvent_.reset(
- new WebGestureEvent(WebGestureEventBuilder::Build(event, self)));
+ new WebGestureEvent(WebInputEventFactory::gestureEvent(event, self)));
// If the page is at the minimum zoom level, require a threshold be reached
// before the pinch has an effect.
@@ -2400,7 +2401,7 @@
return;
if (gestureBeginPinchSent_) {
- WebGestureEvent endEvent(WebGestureEventBuilder::Build(event, self));
+ WebGestureEvent endEvent(WebInputEventFactory::gestureEvent(event, self));
endEvent.type = WebInputEvent::GesturePinchEnd;
renderWidgetHostView_->render_widget_host_->ForwardGestureEvent(endEvent);
gestureBeginPinchSent_ = NO;
@@ -2425,7 +2426,7 @@
- (void)smartMagnifyWithEvent:(NSEvent*)event {
const WebGestureEvent& smartMagnifyEvent =
- WebGestureEventBuilder::Build(event, self);
+ WebInputEventFactory::gestureEvent(event, self);
if (renderWidgetHostView_ && renderWidgetHostView_->render_widget_host_) {
renderWidgetHostView_->render_widget_host_->ForwardGestureEvent(
smartMagnifyEvent);
@@ -2498,7 +2499,7 @@
if (renderWidgetHostView_->render_widget_host_) {
BOOL canRubberbandLeft = [responderDelegate_ canRubberbandLeft:self];
BOOL canRubberbandRight = [responderDelegate_ canRubberbandRight:self];
- WebMouseWheelEvent webEvent = WebMouseWheelEventBuilder::Build(
+ WebMouseWheelEvent webEvent = WebInputEventFactory::mouseWheelEvent(
event, self, canRubberbandLeft, canRubberbandRight);
webEvent.railsMode = mouseWheelFilter_.UpdateRailsMode(webEvent);
if (renderWidgetHostView_->render_widget_host_->delegate() &&
@@ -2539,7 +2540,8 @@
}
// Send a GesturePinchUpdate event.
- WebGestureEvent updateEvent = WebGestureEventBuilder::Build(event, self);
+ WebGestureEvent updateEvent =
+ WebInputEventFactory::gestureEvent(event, self);
updateEvent.data.pinchUpdate.zoomDisabled = !pinchHasReachedZoomThreshold_;
renderWidgetHostView_->render_widget_host_->ForwardGestureEvent(updateEvent);
}
« 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