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

Unified Diff: components/mus/ws/window_tree.cc

Issue 2089183003: mus: Introduce API for embedder to dispatch event to the embeded client. Base URL: https://chromium.googlesource.com/chromium/src.git@mus-parent-window-receives-child-event
Patch Set: Created 4 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 | « components/mus/ws/window_tree.h ('k') | content/browser/gpu/gpu_data_manager_impl_private.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/ws/window_tree.cc
diff --git a/components/mus/ws/window_tree.cc b/components/mus/ws/window_tree.cc
index 382887111c7add1fa98b87e3c4e553d844d52632..e247a5f98a407567358b556ed2f92211633cb2ad 100644
--- a/components/mus/ws/window_tree.cc
+++ b/components/mus/ws/window_tree.cc
@@ -345,9 +345,12 @@ bool WindowTree::SetFocus(const ClientWindowId& window_id) {
bool WindowTree::Embed(const ClientWindowId& window_id,
mojom::WindowTreeClientPtr client,
+ mojom::InputEventHandlerRequest input_handler_request,
uint32_t flags) {
if (!client || !CanEmbed(window_id))
return false;
+ if (input_handler_request.is_pending())
+ client->RequestInputEventHandler(std::move(input_handler_request));
ServerWindow* window = GetWindowByClientId(window_id);
PrepareForEmbed(window);
// When embedding we don't know the user id of where the TreeClient came
@@ -1357,8 +1360,15 @@ void WindowTree::Embed(Id transport_window_id,
mojom::WindowTreeClientPtr client,
uint32_t flags,
const EmbedCallback& callback) {
- callback.Run(
- Embed(ClientWindowId(transport_window_id), std::move(client), flags));
+ bool embedder_dispatches_event_to_embeded_client =
+ !!(flags & mojom::kEmbedFlagEmbedderInterceptsEvents);
+ mojom::InputEventHandlerPtr handler;
+ mojom::InputEventHandlerRequest request =
+ embedder_dispatches_event_to_embeded_client ? GetProxy(&handler)
+ : nullptr;
+ callback.Run(Embed(ClientWindowId(transport_window_id), std::move(client),
+ std::move(request), flags),
+ std::move(handler));
}
void WindowTree::SetFocus(uint32_t change_id, Id transport_window_id) {
« no previous file with comments | « components/mus/ws/window_tree.h ('k') | content/browser/gpu/gpu_data_manager_impl_private.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698