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

Unified Diff: ui/aura/test/event_generator_delegate_aura.cc

Issue 2752903002: Make ui::test::EventGenerator work with PointerEvents in mash (Closed)
Patch Set: review comments Created 3 years, 9 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 | « ui/aura/test/event_generator_delegate_aura.h ('k') | ui/aura/test/mus/window_tree_client_private.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/test/event_generator_delegate_aura.cc
diff --git a/ui/aura/test/event_generator_delegate_aura.cc b/ui/aura/test/event_generator_delegate_aura.cc
index 59d3de3bc5432f38ca00f795d38ebf39e2afba04..25a7e141061b8c3c497d11909b51d124f1bca78f 100644
--- a/ui/aura/test/event_generator_delegate_aura.cc
+++ b/ui/aura/test/event_generator_delegate_aura.cc
@@ -7,6 +7,9 @@
#include "base/macros.h"
#include "base/memory/singleton.h"
#include "ui/aura/client/screen_position_client.h"
+#include "ui/aura/env.h"
+#include "ui/aura/test/env_test_helper.h"
+#include "ui/aura/test/mus/window_tree_client_private.h"
#include "ui/aura/window_event_dispatcher.h"
#include "ui/aura/window_tree_host.h"
#include "ui/base/ime/input_method.h"
@@ -136,5 +139,21 @@ void EventGeneratorDelegateAura::DispatchKeyEventToIME(ui::EventTarget* target,
window->GetHost()->GetInputMethod()->DispatchKeyEvent(event);
}
+void EventGeneratorDelegateAura::DispatchEventToPointerWatchers(
+ ui::EventTarget* target,
+ const ui::PointerEvent& event) {
+ // In non-mus aura PointerWatchers are handled by system-wide EventHandlers,
+ // for example ash::Shell and ash::PointerWatcherAdapter.
+ if (!Env::GetInstance()->HasWindowTreeClient())
+ return;
+
+ // Route the event through WindowTreeClient as in production mus. Does nothing
+ // if there are no PointerWatchers installed.
+ Window* window = static_cast<Window*>(target);
+ WindowTreeClient* window_tree_client = EnvTestHelper().GetWindowTreeClient();
+ WindowTreeClientPrivate(window_tree_client)
+ .CallOnPointerEventObserved(window, ui::Event::Clone(event));
+}
+
} // namespace test
} // namespace aura
« no previous file with comments | « ui/aura/test/event_generator_delegate_aura.h ('k') | ui/aura/test/mus/window_tree_client_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698