Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -1386,6 +1386,12 @@ FILE: ../../../flutter/shell/platform/fuchsia/flutter/component.h
FILE: ../../../flutter/shell/platform/fuchsia/flutter/component_unittest.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/engine.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/engine.h
FILE: ../../../flutter/shell/platform/fuchsia/flutter/flatland_connection.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/flatland_connection.h
FILE: ../../../flutter/shell/platform/fuchsia/flutter/flatland_external_view_embedder.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/flatland_external_view_embedder.h
FILE: ../../../flutter/shell/platform/fuchsia/flutter/flatland_platform_view.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/flatland_platform_view.h
FILE: ../../../flutter/shell/platform/fuchsia/flutter/flutter_runner_fakes.h
FILE: ../../../flutter/shell/platform/fuchsia/flutter/flutter_runner_product_configuration.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/flutter_runner_product_configuration.h
Expand All @@ -1397,6 +1403,8 @@ FILE: ../../../flutter/shell/platform/fuchsia/flutter/fuchsia_external_view_embe
FILE: ../../../flutter/shell/platform/fuchsia/flutter/fuchsia_intl.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/fuchsia_intl.h
FILE: ../../../flutter/shell/platform/fuchsia/flutter/fuchsia_intl_unittest.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/gfx_platform_view.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/gfx_platform_view.h
FILE: ../../../flutter/shell/platform/fuchsia/flutter/gfx_session_connection.cc
FILE: ../../../flutter/shell/platform/fuchsia/flutter/gfx_session_connection.h
FILE: ../../../flutter/shell/platform/fuchsia/flutter/isolate_configurator.cc
Expand Down
9 changes: 9 additions & 0 deletions shell/platform/fuchsia/flutter/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ template("runner_sources") {
"component.h",
"engine.cc",
"engine.h",
"flatland_connection.cc",
"flatland_connection.h",
"flatland_external_view_embedder.cc",
"flatland_external_view_embedder.h",
"flatland_platform_view.cc",
"flatland_platform_view.h",
"flutter_runner_product_configuration.cc",
"flutter_runner_product_configuration.h",
"focus_delegate.cc",
Expand All @@ -67,6 +73,8 @@ template("runner_sources") {
"fuchsia_external_view_embedder.h",
"fuchsia_intl.cc",
"fuchsia_intl.h",
"gfx_platform_view.cc",
"gfx_platform_view.h",
"gfx_session_connection.cc",
"gfx_session_connection.h",
"isolate_configurator.cc",
Expand Down Expand Up @@ -129,6 +137,7 @@ template("runner_sources") {
"$fuchsia_sdk_root/fidl:fuchsia.io",
"$fuchsia_sdk_root/fidl:fuchsia.sys",
"$fuchsia_sdk_root/fidl:fuchsia.ui.app",
"$fuchsia_sdk_root/fidl:fuchsia.ui.composition",
"$fuchsia_sdk_root/fidl:fuchsia.ui.scenic",
"$fuchsia_sdk_root/pkg:async-cpp",
"$fuchsia_sdk_root/pkg:async-default",
Expand Down
23 changes: 23 additions & 0 deletions shell/platform/fuchsia/flutter/component.cc
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,29 @@ void Application::CreateViewWithViewRef(
));
}

void Application::CreateView2(fuchsia::ui::app::CreateView2Args view_args) {
if (!svc_) {
FML_DLOG(ERROR)
<< "Component incoming services was invalid when attempting to "
"create a shell for a view provider request.";
return;
}

shell_holders_.emplace(std::make_unique<Engine>(
*this, // delegate
debug_label_, // thread label
svc_, // Component incoming services
runner_incoming_services_, // Runner incoming services
settings_, // settings
std::move(
*view_args.mutable_view_creation_token()), // view creation token
scenic::ViewRefPair::New(), // view ref pair
std::move(fdio_ns_), // FDIO namespace
std::move(directory_request_), // outgoing request
product_config_ // product configuration
));
}

#if !defined(DART_PRODUCT)
void Application::WriteProfileToTrace() const {
for (const auto& engine : shell_holders_) {
Expand Down
3 changes: 3 additions & 0 deletions shell/platform/fuchsia/flutter/component.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ class Application final : public Engine::Delegate,
fuchsia::ui::views::ViewRefControl control_ref,
fuchsia::ui::views::ViewRef view_ref) override;

// |fuchsia::ui::app::ViewProvider|
void CreateView2(fuchsia::ui::app::CreateView2Args view_args) override;

// |flutter::Engine::Delegate|
void OnEngineTerminate(const Engine* holder) override;

Expand Down
Loading