Commit 8184fccd authored by Julian Pastarmov's avatar Julian Pastarmov Committed by Commit Bot

[sync] Don't populate username and server URL if local sync is enabled.

Those fields are irrelevant for the user when local sync is turned on
because no connection with a sync server can be established in this case.

BUG=972563

Change-Id: I8dab3c48215b8c8fa05218d0df5e318923a849da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1859974Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Commit-Queue: Julian Pastarmov <pastarmovj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708161}
parent 905e57cc
...@@ -454,18 +454,22 @@ std::unique_ptr<base::DictionaryValue> ConstructAboutInformation( ...@@ -454,18 +454,22 @@ std::unique_ptr<base::DictionaryValue> ConstructAboutInformation(
service->GetLastCycleSnapshotForDebugging(); service->GetLastCycleSnapshotForDebugging();
const SyncTokenStatus& token_status = const SyncTokenStatus& token_status =
service->GetSyncTokenStatusForDebugging(); service->GetSyncTokenStatusForDebugging();
bool is_local_sync_enabled_state = service->IsLocalSyncEnabled();
// Version Info. // Version Info.
// |client_version| was already set above. // |client_version| was already set above.
server_url->Set(service->GetSyncServiceUrlForDebugging().spec()); if (!is_local_sync_enabled_state)
server_url->Set(service->GetSyncServiceUrlForDebugging().spec());
// Identity. // Identity.
if (is_status_valid && !full_status.sync_id.empty()) if (is_status_valid && !full_status.sync_id.empty())
sync_client_id->Set(full_status.sync_id); sync_client_id->Set(full_status.sync_id);
if (is_status_valid && !full_status.invalidator_client_id.empty()) if (is_status_valid && !full_status.invalidator_client_id.empty())
invalidator_id->Set(full_status.invalidator_client_id); invalidator_id->Set(full_status.invalidator_client_id);
username->Set(service->GetAuthenticatedAccountInfo().email); if (!is_local_sync_enabled_state) {
user_is_primary->Set(service->IsAuthenticatedAccountPrimary()); username->Set(service->GetAuthenticatedAccountInfo().email);
user_is_primary->Set(service->IsAuthenticatedAccountPrimary());
}
// Credentials. // Credentials.
token_request_time->Set(GetTimeStr(token_status.token_request_time, "n/a")); token_request_time->Set(GetTimeStr(token_status.token_request_time, "n/a"));
...@@ -483,8 +487,8 @@ std::unique_ptr<base::DictionaryValue> ConstructAboutInformation( ...@@ -483,8 +487,8 @@ std::unique_ptr<base::DictionaryValue> ConstructAboutInformation(
is_setup_complete->Set(service->GetUserSettings()->IsFirstSetupComplete()); is_setup_complete->Set(service->GetUserSettings()->IsFirstSetupComplete());
if (is_status_valid) if (is_status_valid)
is_syncing->Set(full_status.syncing); is_syncing->Set(full_status.syncing);
is_local_sync_enabled->Set(service->IsLocalSyncEnabled()); is_local_sync_enabled->Set(is_local_sync_enabled_state);
if (service->IsLocalSyncEnabled() && is_status_valid) if (is_local_sync_enabled_state && is_status_valid)
local_backend_path->Set(full_status.local_sync_folder); local_backend_path->Set(full_status.local_sync_folder);
// Network. // Network.
......
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