Commit 72280394 authored by sandromaggi's avatar sandromaggi Committed by Commit Bot

[Autofill Assistant] Don't reset overlay_image if it's missing

Before this change, a missing entry of |overlay_image| would reset it. Now
to unset it one needs to add an invalid (e.g. empty) setting for it.

Bug: b/161870830
Change-Id: I9a7fa1b11fe437071a7e4bbea11b44fb95f3b1c5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2315858Reviewed-by: default avatarMathias Carlen <mcarlen@chromium.org>
Commit-Queue: Sandro Maggi <sandromaggi@google.com>
Cr-Commit-Position: refs/heads/master@{#791192}
parent b07a8b1a
......@@ -78,16 +78,12 @@ void ClientSettings::UpdateFromProto(const ClientSettingsProto& proto) {
tap_shutdown_delay =
base::TimeDelta::FromMilliseconds(proto.tap_shutdown_delay_ms());
}
if (proto.has_overlay_image() &&
IsValidOverlayImageProto(proto.overlay_image())) {
overlay_image = proto.overlay_image();
} else {
overlay_image.reset();
}
if (proto.has_integration_test_settings()) {
integration_test_settings = proto.integration_test_settings();
} else {
integration_test_settings.reset();
if (proto.has_overlay_image()) {
if (IsValidOverlayImageProto(proto.overlay_image())) {
overlay_image = proto.overlay_image();
} else {
overlay_image.reset();
}
}
if (proto.has_talkback_sheet_size_fraction()) {
talkback_sheet_size_fraction = proto.talkback_sheet_size_fraction();
......@@ -100,6 +96,13 @@ void ClientSettings::UpdateFromProto(const ClientSettingsProto& proto) {
back_button_settings.reset();
}
}
// Test only settings.
if (proto.has_integration_test_settings()) {
integration_test_settings = proto.integration_test_settings();
} else {
integration_test_settings.reset();
}
}
} // namespace autofill_assistant
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment