5#include "flutter/shell/platform/common/incoming_message_dispatcher.h"
11 : messenger_(messenger) {}
20 std::string channel(
message.channel);
22 auto callback_iterator = callbacks_.find(channel);
24 if (callback_iterator == callbacks_.end()) {
29 auto& callback_info = callback_iterator->second;
33 bool block_input = input_blocking_channels_.count(channel) > 0;
37 message_callback(messenger_, &
message, callback_info.second);
44 const std::string& channel,
48 callbacks_.erase(channel);
55 const std::string& channel) {
56 input_blocking_channels_.insert(channel);
void HandleMessage(const FlutterDesktopMessage &message, const std::function< void(void)> &input_block_cb=[] {}, const std::function< void(void)> &input_unblock_cb=[] {})
IncomingMessageDispatcher(FlutterDesktopMessengerRef messenger)
void EnableInputBlockingForChannel(const std::string &channel)
void SetMessageCallback(const std::string &channel, FlutterDesktopMessageCallback callback, void *user_data)
virtual ~IncomingMessageDispatcher()
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
void(* FlutterDesktopMessageCallback)(FlutterDesktopMessengerRef, const FlutterDesktopMessage *, void *)
Dart_NativeFunction function
void FlutterDesktopMessengerSendResponse(FlutterDesktopMessengerRef messenger, const FlutterDesktopMessageResponseHandle *handle, const uint8_t *data, size_t data_length)