mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
Remove usage of fuchsia.modular.Clipboard. (#13763)
It is deprecated and will go away.
This commit is contained in:
@@ -8,7 +8,6 @@
|
||||
"fuchsia.fonts.Provider",
|
||||
"fuchsia.intl.PropertyProvider",
|
||||
"fuchsia.logger.LogSink",
|
||||
"fuchsia.modular.Clipboard",
|
||||
"fuchsia.modular.ContextWriter",
|
||||
"fuchsia.modular.ModuleContext",
|
||||
"fuchsia.netstack.Netstack",
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
"fuchsia.fonts.Provider",
|
||||
"fuchsia.intl.PropertyProvider",
|
||||
"fuchsia.logger.LogSink",
|
||||
"fuchsia.modular.Clipboard",
|
||||
"fuchsia.modular.ContextWriter",
|
||||
"fuchsia.modular.ModuleContext",
|
||||
"fuchsia.netstack.Netstack",
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
"fuchsia.fonts.Provider",
|
||||
"fuchsia.intl.PropertyProvider",
|
||||
"fuchsia.logger.LogSink",
|
||||
"fuchsia.modular.Clipboard",
|
||||
"fuchsia.modular.ContextWriter",
|
||||
"fuchsia.modular.ModuleContext",
|
||||
"fuchsia.netstack.Netstack",
|
||||
|
||||
@@ -278,7 +278,6 @@ executable("flutter_runner_unittests") {
|
||||
":aot",
|
||||
":flutter_runner_fixtures",
|
||||
"//build/fuchsia/fidl:fuchsia.accessibility.semantics",
|
||||
"//build/fuchsia/fidl:fuchsia.modular",
|
||||
"//build/fuchsia/pkg:async-loop-cpp",
|
||||
"//build/fuchsia/pkg:async-loop-default",
|
||||
"//build/fuchsia/pkg:scenic_cpp",
|
||||
|
||||
@@ -115,7 +115,6 @@ template("flutter_runner") {
|
||||
"$fuchsia_sdk_root/fidl:fuchsia.images",
|
||||
"$fuchsia_sdk_root/fidl:fuchsia.intl",
|
||||
"$fuchsia_sdk_root/fidl:fuchsia.io",
|
||||
"$fuchsia_sdk_root/fidl:fuchsia.modular",
|
||||
"$fuchsia_sdk_root/fidl:fuchsia.sys",
|
||||
"$fuchsia_sdk_root/fidl:fuchsia.ui.app",
|
||||
"$fuchsia_sdk_root/fidl:fuchsia.ui.scenic",
|
||||
|
||||
@@ -110,15 +110,11 @@ PlatformView::PlatformView(
|
||||
SetInterfaceErrorHandler(session_listener_binding_, "SessionListener");
|
||||
SetInterfaceErrorHandler(ime_, "Input Method Editor");
|
||||
SetInterfaceErrorHandler(text_sync_service_, "Text Sync Service");
|
||||
SetInterfaceErrorHandler(clipboard_, "Clipboard");
|
||||
SetInterfaceErrorHandler(parent_environment_service_provider_,
|
||||
"Parent Environment Service Provider");
|
||||
// Access the clipboard.
|
||||
// Access the IME service.
|
||||
parent_environment_service_provider_ =
|
||||
parent_environment_service_provider_handle.Bind();
|
||||
parent_environment_service_provider_.get()->ConnectToService(
|
||||
fuchsia::modular::Clipboard::Name_,
|
||||
clipboard_.NewRequest().TakeChannel());
|
||||
|
||||
parent_environment_service_provider_.get()->ConnectToService(
|
||||
fuchsia::ui::input::ImeService::Name_,
|
||||
@@ -638,28 +634,8 @@ void PlatformView::HandleFlutterPlatformChannelPlatformMessage(
|
||||
return;
|
||||
}
|
||||
|
||||
fml::RefPtr<flutter::PlatformMessageResponse> response = message->response();
|
||||
if (method->value == "Clipboard.setData") {
|
||||
auto text = root["args"]["text"].GetString();
|
||||
clipboard_->Push(text);
|
||||
response->CompleteEmpty();
|
||||
} else if (method->value == "Clipboard.getData") {
|
||||
clipboard_->Peek([response](fidl::StringPtr text) {
|
||||
rapidjson::StringBuffer json_buffer;
|
||||
rapidjson::Writer<rapidjson::StringBuffer> writer(json_buffer);
|
||||
writer.StartArray();
|
||||
writer.StartObject();
|
||||
writer.Key("text");
|
||||
writer.String(text.value_or(""));
|
||||
writer.EndObject();
|
||||
writer.EndArray();
|
||||
std::string result = json_buffer.GetString();
|
||||
response->Complete(std::make_unique<fml::DataMapping>(
|
||||
std::vector<uint8_t>{result.begin(), result.end()}));
|
||||
});
|
||||
} else {
|
||||
response->CompleteEmpty();
|
||||
}
|
||||
// Fuchsia does not handle any platform messages at this time.
|
||||
message->response()->CompleteEmpty();
|
||||
}
|
||||
|
||||
// Channel handler for kTextInputChannel
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
#include <fuchsia/modular/cpp/fidl.h>
|
||||
#include <fuchsia/ui/gfx/cpp/fidl.h>
|
||||
#include <fuchsia/ui/input/cpp/fidl.h>
|
||||
#include <fuchsia/ui/scenic/cpp/fidl.h>
|
||||
@@ -91,7 +90,6 @@ class PlatformView final : public flutter::PlatformView,
|
||||
fuchsia::ui::input::ImeServicePtr text_sync_service_;
|
||||
|
||||
fuchsia::sys::ServiceProviderPtr parent_environment_service_provider_;
|
||||
fuchsia::modular::ClipboardPtr clipboard_;
|
||||
std::unique_ptr<Surface> surface_;
|
||||
flutter::LogicalMetrics metrics_;
|
||||
fuchsia::ui::gfx::Metrics scenic_metrics_;
|
||||
|
||||
Reference in New Issue
Block a user