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
3 changes: 0 additions & 3 deletions ci/licenses_golden/licenses_flutter
Original file line number Diff line number Diff line change
Expand Up @@ -1583,9 +1583,6 @@ FILE: ../../../flutter/shell/platform/windows/platform_handler_win32.h
FILE: ../../../flutter/shell/platform/windows/platform_handler_winuwp.cc
FILE: ../../../flutter/shell/platform/windows/platform_handler_winuwp.h
FILE: ../../../flutter/shell/platform/windows/public/flutter_windows.h
FILE: ../../../flutter/shell/platform/windows/registry.cc
FILE: ../../../flutter/shell/platform/windows/registry.h
FILE: ../../../flutter/shell/platform/windows/registry_unittests.cc
FILE: ../../../flutter/shell/platform/windows/string_conversion.cc
FILE: ../../../flutter/shell/platform/windows/string_conversion.h
FILE: ../../../flutter/shell/platform/windows/string_conversion_unittests.cc
Expand Down
16 changes: 0 additions & 16 deletions shell/platform/windows/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -171,18 +171,6 @@ source_set("flutter_windows_source") {
]
}

# Windows registry utilities.
source_set("registry") {
sources = [
"registry.cc",
"registry.h",
]

if (target_os == "winuwp") {
cflags = [ "/EHsc" ]
}
}

# String encoding conversion utilities.
source_set("string_conversion") {
sources = [
Expand Down Expand Up @@ -233,7 +221,6 @@ executable("flutter_windows_unittests") {
sources = [
# "flutter_project_bundle_unittests.cc", //TODO failing due to switches test failing. Blocked on https://github.com/flutter/flutter/issues/74153
# "flutter_windows_engine_unittests.cc", //TODO failing to send / receive platform message get plugins working first. Blocked on https://github.com/flutter/flutter/issues/74155
"registry_unittests.cc",
"string_conversion_unittests.cc",
"system_utils_unittests.cc",
"testing/engine_modifier.h",
Expand Down Expand Up @@ -273,7 +260,6 @@ executable("flutter_windows_unittests") {
":flutter_windows_fixtures",
":flutter_windows_headers",
":flutter_windows_source",
":registry",
"//flutter/shell/platform/common:common_cpp",
"//flutter/shell/platform/embedder:embedder_as_internal_library",
"//flutter/shell/platform/embedder:embedder_test_utils",
Expand Down Expand Up @@ -333,8 +319,6 @@ source_set("uwptool_utils") {
"uwptool_utils.cc",
"uwptool_utils.h",
]

deps = [ ":registry" ]
}

# Command-line tool used by the flutter tool that serves a similar purpose to
Expand Down
87 changes: 0 additions & 87 deletions shell/platform/windows/registry.cc

This file was deleted.

61 changes: 0 additions & 61 deletions shell/platform/windows/registry.h

This file was deleted.

50 changes: 0 additions & 50 deletions shell/platform/windows/registry_unittests.cc

This file was deleted.

2 changes: 1 addition & 1 deletion shell/platform/windows/uwptool_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ int main(int argc, char** argv) {
}

// Write an informative message for the user to stderr.
std::cerr << "Launched app with package_id " << package_id
std::cerr << "Launched app with package ID " << package_id
<< ". PID: " << std::endl;
// Write the PID to stdout. The flutter tool reads this value in.
std::cout << process_id << std::endl;
Expand Down
18 changes: 9 additions & 9 deletions shell/platform/windows/uwptool_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
#include <Windows.h>
#include <Winreg.h>
#include <shobjidl_core.h>
#include <winrt/Windows.ApplicationModel.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Management.Deployment.h>
#include <winrt/base.h>

#include <string>
Expand Down Expand Up @@ -41,17 +44,14 @@ int Application::Launch(const std::wstring_view args) {
}

std::vector<Application> ApplicationStore::GetInstalledApplications() {
constexpr wchar_t kMappingsKey[] =
L"\\Local Settings\\Software\\Microsoft\\Windows\\CurrentVersion"
L"\\AppModel\\Repository\\Families";
RegistryKey mappings_key(HKEY_CLASSES_ROOT, kMappingsKey, KEY_READ);
if (!mappings_key.IsValid()) {
return {};
}
using winrt::Windows::ApplicationModel::Package;
using winrt::Windows::Management::Deployment::PackageManager;

// Find packages for the current user (default for empty string).
PackageManager package_manager;
std::unordered_set<std::wstring> package_ids;
for (const std::wstring& subkey_name : mappings_key.GetSubKeyNames()) {
package_ids.emplace(subkey_name);
for (const Package& package : package_manager.FindPackagesForUser(L"")) {
package_ids.emplace(package.Id().FamilyName().c_str());
}
std::vector<Application> apps(package_ids.begin(), package_ids.end());
return apps;
Expand Down
4 changes: 1 addition & 3 deletions shell/platform/windows/uwptool_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include <string>
#include <vector>

#include "flutter/shell/platform/windows/registry.h"

namespace flutter {

// A UWP application.
Expand All @@ -19,7 +17,7 @@ class Application {
Application(const Application& other) = default;
Application& operator=(const Application& other) = default;

// Returns the application user model ID.
// Returns the package ID.
std::wstring GetPackageId() const { return package_id_; }

// Launches the application with the specified list of launch arguments.
Expand Down