Commit 8329206c authored by Colin Blundell's avatar Colin Blundell Committed by Commit Bot

[Sync] Always initialize username in about sync information

sync_ui_util::ConstructAboutInformation() currently only initializes the
username field if SyncService::signin() is non-null. In an upcoming
refactoring to change this function to use the Identity Service instead,
it will no longer be possible for the client to differentiate the
situation where SyncService::signin() is null from the situation where
the user simply isn't signed in.

To avoid coupling a behavioral change with a refactoring, this CL first
explicitly makes the behavioral change to initialize the username field
in all cases, setting it to the empty string if SyncService::signin() is
null.

The only user-visible effect that this will have is that if there are
any situations wher SyncService::signin() is null in production, the
user will see the username field being empty in chrome://sync-internals
rather than having a value of "Uninitialized."

Bug: 783144
Change-Id: Ie090a2635549072f86d15b86fb98891396abdb08
Reviewed-on: https://chromium-review.googlesource.com/758685Reviewed-by: default avatarNicolas Zea <zea@chromium.org>
Commit-Queue: Colin Blundell <blundell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515505}
parent 1ea958f5
...@@ -464,6 +464,8 @@ std::unique_ptr<base::DictionaryValue> ConstructAboutInformation( ...@@ -464,6 +464,8 @@ std::unique_ptr<base::DictionaryValue> ConstructAboutInformation(
invalidator_id.SetValue(full_status.invalidator_client_id); invalidator_id.SetValue(full_status.invalidator_client_id);
if (service->signin()) if (service->signin())
username.SetValue(service->signin()->GetAuthenticatedAccountInfo().email); username.SetValue(service->signin()->GetAuthenticatedAccountInfo().email);
else
username.SetValue(std::string());
const SyncService::SyncTokenStatus& token_status = const SyncService::SyncTokenStatus& token_status =
service->GetSyncTokenStatus(); service->GetSyncTokenStatus();
......
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