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

Unified Diff: content/public/test/browser_test_utils.cc

Issue 1412923009: Route touch-events for WebViewGuest directly to guest renderer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update comments (saving first this time). Created 5 years 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
« no previous file with comments | « content/public/test/browser_test_utils.h ('k') | content/renderer/browser_plugin/browser_plugin.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/test/browser_test_utils.cc
diff --git a/content/public/test/browser_test_utils.cc b/content/public/test/browser_test_utils.cc
index 79fd6170245e383d4f99aa70ed7ff58aec365016..3455dd8d5b53e337a762e64c67c94738005a6b51 100644
--- a/content/public/test/browser_test_utils.cc
+++ b/content/public/test/browser_test_utils.cc
@@ -49,10 +49,12 @@
#include "ui/resources/grit/webui_resources.h"
#if defined(USE_AURA)
+#include "content/browser/renderer_host/render_widget_host_view_aura.h"
#include "ui/aura/test/window_event_dispatcher_test_api.h"
#include "ui/aura/window.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
+#include "ui/events/event.h"
#endif // USE_AURA
namespace content {
@@ -526,13 +528,14 @@ void SimulateTapWithModifiersAt(WebContents* web_contents,
widget_host->ForwardGestureEvent(tap);
}
+#if defined(USE_AURA)
void SimulateTouchPressAt(WebContents* web_contents, const gfx::Point& point) {
- SyntheticWebTouchEvent touch;
- touch.PressPoint(point.x(), point.y());
- RenderWidgetHostImpl* widget_host = RenderWidgetHostImpl::From(
- web_contents->GetRenderViewHost()->GetWidget());
- widget_host->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo());
+ ui::TouchEvent touch(ui::ET_TOUCH_PRESSED, point, 0, base::TimeDelta());
+ static_cast<RenderWidgetHostViewAura*>(
+ web_contents->GetRenderWidgetHostView())
+ ->OnTouchEvent(&touch);
}
+#endif
void SimulateKeyPress(WebContents* web_contents,
ui::KeyboardCode key_code,
« no previous file with comments | « content/public/test/browser_test_utils.h ('k') | content/renderer/browser_plugin/browser_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698