Skip to content

Commit 31cd2df

Browse files
gabeschineiskakaushik
authored andcommitted
Remove usage of fuchsia.modular.Clipboard. (flutter#13763)
It is deprecated and will go away.
1 parent e0b9a2b commit 31cd2df

File tree

7 files changed

+3
-34
lines changed

7 files changed

+3
-34
lines changed

shell/platform/fuchsia/dart_runner/integration/meta/dart_aot_runner_test.cmx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"fuchsia.fonts.Provider",
99
"fuchsia.intl.PropertyProvider",
1010
"fuchsia.logger.LogSink",
11-
"fuchsia.modular.Clipboard",
1211
"fuchsia.modular.ContextWriter",
1312
"fuchsia.modular.ModuleContext",
1413
"fuchsia.netstack.Netstack",

shell/platform/fuchsia/dart_runner/integration/meta/dart_jit_runner_test.cmx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"fuchsia.fonts.Provider",
1212
"fuchsia.intl.PropertyProvider",
1313
"fuchsia.logger.LogSink",
14-
"fuchsia.modular.Clipboard",
1514
"fuchsia.modular.ContextWriter",
1615
"fuchsia.modular.ModuleContext",
1716
"fuchsia.netstack.Netstack",

shell/platform/fuchsia/dart_runner/vmservice/meta/vmservice.cmx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"fuchsia.fonts.Provider",
99
"fuchsia.intl.PropertyProvider",
1010
"fuchsia.logger.LogSink",
11-
"fuchsia.modular.Clipboard",
1211
"fuchsia.modular.ContextWriter",
1312
"fuchsia.modular.ModuleContext",
1413
"fuchsia.netstack.Netstack",

shell/platform/fuchsia/flutter/BUILD.gn

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,6 @@ executable("flutter_runner_unittests") {
278278
":aot",
279279
":flutter_runner_fixtures",
280280
"//build/fuchsia/fidl:fuchsia.accessibility.semantics",
281-
"//build/fuchsia/fidl:fuchsia.modular",
282281
"//build/fuchsia/pkg:async-loop-cpp",
283282
"//build/fuchsia/pkg:async-loop-default",
284283
"//build/fuchsia/pkg:scenic_cpp",

shell/platform/fuchsia/flutter/engine_flutter_runner.gni

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ template("flutter_runner") {
115115
"$fuchsia_sdk_root/fidl:fuchsia.images",
116116
"$fuchsia_sdk_root/fidl:fuchsia.intl",
117117
"$fuchsia_sdk_root/fidl:fuchsia.io",
118-
"$fuchsia_sdk_root/fidl:fuchsia.modular",
119118
"$fuchsia_sdk_root/fidl:fuchsia.sys",
120119
"$fuchsia_sdk_root/fidl:fuchsia.ui.app",
121120
"$fuchsia_sdk_root/fidl:fuchsia.ui.scenic",

shell/platform/fuchsia/flutter/platform_view.cc

Lines changed: 3 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,11 @@ PlatformView::PlatformView(
110110
SetInterfaceErrorHandler(session_listener_binding_, "SessionListener");
111111
SetInterfaceErrorHandler(ime_, "Input Method Editor");
112112
SetInterfaceErrorHandler(text_sync_service_, "Text Sync Service");
113-
SetInterfaceErrorHandler(clipboard_, "Clipboard");
114113
SetInterfaceErrorHandler(parent_environment_service_provider_,
115114
"Parent Environment Service Provider");
116-
// Access the clipboard.
115+
// Access the IME service.
117116
parent_environment_service_provider_ =
118117
parent_environment_service_provider_handle.Bind();
119-
parent_environment_service_provider_.get()->ConnectToService(
120-
fuchsia::modular::Clipboard::Name_,
121-
clipboard_.NewRequest().TakeChannel());
122118

123119
parent_environment_service_provider_.get()->ConnectToService(
124120
fuchsia::ui::input::ImeService::Name_,
@@ -638,28 +634,8 @@ void PlatformView::HandleFlutterPlatformChannelPlatformMessage(
638634
return;
639635
}
640636

641-
fml::RefPtr<flutter::PlatformMessageResponse> response = message->response();
642-
if (method->value == "Clipboard.setData") {
643-
auto text = root["args"]["text"].GetString();
644-
clipboard_->Push(text);
645-
response->CompleteEmpty();
646-
} else if (method->value == "Clipboard.getData") {
647-
clipboard_->Peek([response](fidl::StringPtr text) {
648-
rapidjson::StringBuffer json_buffer;
649-
rapidjson::Writer<rapidjson::StringBuffer> writer(json_buffer);
650-
writer.StartArray();
651-
writer.StartObject();
652-
writer.Key("text");
653-
writer.String(text.value_or(""));
654-
writer.EndObject();
655-
writer.EndArray();
656-
std::string result = json_buffer.GetString();
657-
response->Complete(std::make_unique<fml::DataMapping>(
658-
std::vector<uint8_t>{result.begin(), result.end()}));
659-
});
660-
} else {
661-
response->CompleteEmpty();
662-
}
637+
// Fuchsia does not handle any platform messages at this time.
638+
message->response()->CompleteEmpty();
663639
}
664640

665641
// Channel handler for kTextInputChannel

shell/platform/fuchsia/flutter/platform_view.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
#include <map>
99
#include <set>
1010

11-
#include <fuchsia/modular/cpp/fidl.h>
1211
#include <fuchsia/ui/gfx/cpp/fidl.h>
1312
#include <fuchsia/ui/input/cpp/fidl.h>
1413
#include <fuchsia/ui/scenic/cpp/fidl.h>
@@ -91,7 +90,6 @@ class PlatformView final : public flutter::PlatformView,
9190
fuchsia::ui::input::ImeServicePtr text_sync_service_;
9291

9392
fuchsia::sys::ServiceProviderPtr parent_environment_service_provider_;
94-
fuchsia::modular::ClipboardPtr clipboard_;
9593
std::unique_ptr<Surface> surface_;
9694
flutter::LogicalMetrics metrics_;
9795
fuchsia::ui::gfx::Metrics scenic_metrics_;

0 commit comments

Comments
 (0)