Skip to content

Commit

Permalink
borealis: Do not show strings via insert_coin
Browse files Browse the repository at this point in the history
The insert_coin strings are not UX reviewed and we now have better UI
surfaces to show them, so rely on those instead.

The arcade-cabinet graphic will still be shown but it will have no text
on its screen in any case. If the installation request would fail
"error" is shown undertneath the arcade cabinet and we pop up the
"installation disallowed" dialog.

Bug: b:218403711
Change-Id: Ib06ceda220c05cc658ee5ffc2d3b18addea55046
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4546897
Reviewed-by: Chloe Pelling <cpelling@google.com>
Commit-Queue: Nic Hollingum <hollingum@google.com>
Cr-Commit-Position: refs/heads/main@{#1150162}
  • Loading branch information
Nicholas Hollingum authored and Chromium LUCI CQ committed May 29, 2023
1 parent 9ee7bbd commit cfcd8c0
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 34 deletions.
1 change: 1 addition & 0 deletions chrome/browser/ash/borealis/borealis_app_launcher_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ void BorealisAppLauncherImpl::Launch(std::string app_id,
->Features()
.IsEnabled()) {
borealis::ShowBorealisInstallerView(profile_);
std::move(callback).Run(LaunchResult::kSuccess);
return;
}
if (!borealis::BorealisService::GetForProfile(profile_)
Expand Down
3 changes: 0 additions & 3 deletions chrome/browser/ash/borealis/borealis_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ const char kBorealisAppIdRegex[] = "(?:steam:\\/\\/rungameid\\/)(\\d+)";
const char kCompatToolVersionGameMismatch[] = "UNKNOWN (GameID mismatch)";
const char kDeviceInformationKey[] = "entry.1613887985";

const char kInsertCoinSuccessMessage[] = "Success";
const char kInsertCoinRejectMessage[] = "Coin Invalid";

namespace {

// Base feedback form URL, without query parameters for prefilling.
Expand Down
5 changes: 0 additions & 5 deletions chrome/browser/ash/borealis/borealis_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@ extern const char kCompatToolVersionGameMismatch[];
// form.
extern const char kDeviceInformationKey[];

// TODO(b/218403711): remove these when insert_coin is deprecated. We only have
// insert_coin in the short-term until installer UX is finalized.
extern const char kInsertCoinSuccessMessage[];
extern const char kInsertCoinRejectMessage[];

struct CompatToolInfo {
absl::optional<int> game_id;
std::string proton = "None";
Expand Down
48 changes: 22 additions & 26 deletions chrome/browser/ash/dbus/vm/vm_launch_service_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,39 +34,35 @@ void OnExported(const std::string& interface_name,
<< method_name;
}

std::unique_ptr<dbus::Response> AllowStatusToResponse(
borealis::BorealisFeatures::AllowStatus status,
dbus::MethodCall* method_call) {
if (status != borealis::BorealisFeatures::AllowStatus::kAllowed) {
return dbus::ErrorResponse::FromMethodCall(method_call, DBUS_ERROR_FAILED,
"");
}

std::unique_ptr<dbus::Response> response =
dbus::Response::FromMethodCall(method_call);
dbus::MessageWriter writer(response.get());
writer.AppendString("");
return response;
}

void OnTokenChecked(Profile* profile,
dbus::MethodCall* method_call,
dbus::ExportedObject::ResponseSender response_sender,
bool launch,
borealis::BorealisFeatures::AllowStatus new_allowed) {
// TODO(b/218403711): Remove these messages. These messages are shown to users
// of the Borealis Alpha based on the status of their device, however they are
// not translated, because this API is only a temporary measure put in place
// until borealis' installer UX is finalized.
if (new_allowed == borealis::BorealisFeatures::AllowStatus::kAllowed) {
if (launch) {
// When requested, setting the correct token should have the effect of
// running the client app, which will bring up the installer or launch the
// client as needed.
borealis::BorealisService::GetForProfile(profile)->AppLauncher().Launch(
borealis::kClientAppId, base::DoNothing());
}
std::unique_ptr<dbus::Response> response =
dbus::Response::FromMethodCall(method_call);
dbus::MessageWriter writer(response.get());
writer.AppendString(borealis::kInsertCoinSuccessMessage);
std::move(response_sender).Run(std::move(response));
return;
}
std::stringstream ss;
if (new_allowed == borealis::BorealisFeatures::AllowStatus::kIncorrectToken) {
ss << borealis::kInsertCoinRejectMessage;
} else {
ss << new_allowed;
if (launch) {
// When requested, setting the correct token should have the effect of
// running the client app, which will bring up the installer or launch the
// client as needed.
borealis::BorealisService::GetForProfile(profile)->AppLauncher().Launch(
borealis::kClientAppId, base::DoNothing());
}
std::move(response_sender)
.Run(dbus::ErrorResponse::FromMethodCall(method_call, DBUS_ERROR_FAILED,
ss.str()));
.Run(AllowStatusToResponse(new_allowed, method_call));
}

template <typename T>
Expand Down

0 comments on commit cfcd8c0

Please sign in to comment.