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

Unified Diff: content/renderer/mus/compositor_mus_connection.cc

Issue 1891413002: mash: Convert OnWindowInputEventAck to use an enum for handled status (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: missed a file Created 4 years, 8 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/renderer/mus/compositor_mus_connection.cc
diff --git a/content/renderer/mus/compositor_mus_connection.cc b/content/renderer/mus/compositor_mus_connection.cc
index 0ae3a84e54c01ae84717110d783bac94b608e03f..1a92d06629ebe658a5c11653ae104c63b8c672d7 100644
--- a/content/renderer/mus/compositor_mus_connection.cc
+++ b/content/renderer/mus/compositor_mus_connection.cc
@@ -12,9 +12,11 @@
#include "mojo/converters/input_events/input_events_type_converters.h"
#include "ui/latency_info/latency_info.h"
+using mus::mojom::EventResult;
+
namespace {
-void DoNothingBool(bool result) {}
+void DoNothingWithEventResult(EventResult result) {}
} // namespace
@@ -78,22 +80,22 @@ void CompositorMusConnection::OnConnectionLostOnMainThread() {
void CompositorMusConnection::OnWindowInputEventOnMainThread(
std::unique_ptr<blink::WebInputEvent> web_event,
- const base::Callback<void(bool)>& ack) {
+ const base::Callback<void(EventResult)>& ack) {
DCHECK(main_task_runner_->BelongsToCurrentThread());
RenderWidgetMusConnection* connection =
RenderWidgetMusConnection::Get(routing_id_);
if (!connection) {
- ack.Run(false);
+ ack.Run(EventResult::UNHANDLED);
return;
}
connection->OnWindowInputEvent(std::move(web_event), ack);
}
void CompositorMusConnection::OnWindowInputEventAckOnMainThread(
- const base::Callback<void(bool)>& ack,
- bool handled) {
+ const base::Callback<void(EventResult)>& ack,
+ EventResult result) {
DCHECK(main_task_runner_->BelongsToCurrentThread());
- compositor_task_runner_->PostTask(FROM_HERE, base::Bind(ack, handled));
+ compositor_task_runner_->PostTask(FROM_HERE, base::Bind(ack, result));
}
void CompositorMusConnection::OnConnectionLost(
@@ -117,7 +119,7 @@ void CompositorMusConnection::OnEmbed(mus::Window* root) {
void CompositorMusConnection::OnWindowInputEvent(
mus::Window* window,
const ui::Event& event,
- std::unique_ptr<base::Callback<void(bool)>>* ack_callback) {
+ std::unique_ptr<base::Callback<void(EventResult)>>* ack_callback) {
DCHECK(compositor_task_runner_->BelongsToCurrentThread());
// TODO(moshayedi): Convert ui::Event directly to blink::WebInputEvent.
std::unique_ptr<blink::WebInputEvent> web_event(
@@ -131,7 +133,8 @@ void CompositorMusConnection::OnWindowInputEvent(
// state.
if (ack_state != INPUT_EVENT_ACK_STATE_NOT_CONSUMED)
return;
- base::Callback<void(bool)> ack = base::Bind(&::DoNothingBool);
+ base::Callback<void(EventResult)> ack =
+ base::Bind(&::DoNothingWithEventResult);
const bool send_ack = WebInputEventTraits::ShouldBlockEventStream(*web_event);
if (send_ack) {
// Ultimately, this ACK needs to go back to the Mus client lib which is not
« no previous file with comments | « content/renderer/mus/compositor_mus_connection.h ('k') | content/renderer/mus/compositor_mus_connection_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698