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

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

Issue 1180503002: Force a GuestView's embedder to be focused on TouchStart. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Release observer on destruction. Make webview focused (for Windows). Created 5 years, 6 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
« no previous file with comments | « content/public/test/browser_test_utils.h ('k') | no next file » | 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 05d09db6b3678bdf959132e2ffa93e6cf9d7e755..001ceeaab81a8e46bfd863aba448a2d735da27fb 100644
--- a/content/public/test/browser_test_utils.cc
+++ b/content/public/test/browser_test_utils.cc
@@ -47,6 +47,7 @@
#include "ui/events/gesture_detection/gesture_configuration.h"
#include "ui/events/keycodes/dom/dom_code.h"
#include "ui/events/keycodes/dom/keycode_converter.h"
+#include "ui/events/latency_info.h"
#include "ui/resources/grit/webui_resources.h"
#if defined(USE_AURA)
@@ -431,6 +432,14 @@ void SimulateTapWithModifiersAt(WebContents* web_contents,
widget_host->ForwardGestureEvent(tap);
}
+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());
+ widget_host->ForwardTouchEventWithLatencyInfo(touch, ui::LatencyInfo());
+}
+
void SimulateKeyPress(WebContents* web_contents,
ui::KeyboardCode key_code,
bool control,
@@ -961,6 +970,12 @@ bool WebContentsAddedObserver::RenderViewCreatedCalled() {
return false;
}
+bool RequestFrame(WebContents* web_contents) {
+ DCHECK(web_contents);
+ return RenderWidgetHostImpl::From(web_contents->GetRenderViewHost())
+ ->ScheduleComposite();
+}
+
FrameWatcher::FrameWatcher()
: BrowserMessageFilter(ViewMsgStart), frames_to_wait_(0) {
}
@@ -982,6 +997,13 @@ bool FrameWatcher::OnMessageReceived(const IPC::Message& message) {
return false;
}
+void FrameWatcher::AttachTo(WebContents* web_contents) {
+ DCHECK(web_contents);
+ RenderWidgetHostImpl* widget_host =
+ RenderWidgetHostImpl::From(web_contents->GetRenderViewHost());
+ widget_host->GetProcess()->AddFilter(this);
+}
+
void FrameWatcher::WaitFrames(int frames_to_wait) {
if (frames_to_wait <= 0)
return;
« no previous file with comments | « content/public/test/browser_test_utils.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698