| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/sync/about_sync_util.h" | 5 #include "chrome/browser/sync/about_sync_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 // a class is instantiated, which allows us to reference the fields in | 172 // a class is instantiated, which allows us to reference the fields in |
| 173 // 'setter' code later on in this function. | 173 // 'setter' code later on in this function. |
| 174 ListValue* section_summary = AddSection(stats_list, "Summary"); | 174 ListValue* section_summary = AddSection(stats_list, "Summary"); |
| 175 StringSyncStat summary_string(section_summary, "Summary"); | 175 StringSyncStat summary_string(section_summary, "Summary"); |
| 176 | 176 |
| 177 ListValue* section_version = AddSection(stats_list, "Version Info"); | 177 ListValue* section_version = AddSection(stats_list, "Version Info"); |
| 178 StringSyncStat client_version(section_version, "Client Version"); | 178 StringSyncStat client_version(section_version, "Client Version"); |
| 179 StringSyncStat server_url(section_version, "Server URL"); | 179 StringSyncStat server_url(section_version, "Server URL"); |
| 180 | 180 |
| 181 ListValue* section_credentials = AddSection(stats_list, kCredentialsTitle); | 181 ListValue* section_credentials = AddSection(stats_list, kCredentialsTitle); |
| 182 StringSyncStat client_id(section_credentials, "Client ID"); | 182 StringSyncStat sync_id(section_credentials, "Sync Client ID"); |
| 183 StringSyncStat invalidator_id(section_credentials, "Invalidator Client ID"); |
| 183 StringSyncStat username(section_credentials, "Username"); | 184 StringSyncStat username(section_credentials, "Username"); |
| 184 BoolSyncStat is_token_available(section_credentials, "Sync Token Available"); | 185 BoolSyncStat is_token_available(section_credentials, "Sync Token Available"); |
| 185 | 186 |
| 186 ListValue* section_local = AddSection(stats_list, "Local State"); | 187 ListValue* section_local = AddSection(stats_list, "Local State"); |
| 187 StringSyncStat last_synced(section_local, "Last Synced"); | 188 StringSyncStat last_synced(section_local, "Last Synced"); |
| 188 BoolSyncStat is_setup_complete(section_local, | 189 BoolSyncStat is_setup_complete(section_local, |
| 189 "Sync First-Time Setup Complete"); | 190 "Sync First-Time Setup Complete"); |
| 190 BoolSyncStat is_backend_initialized(section_local, | 191 BoolSyncStat is_backend_initialized(section_local, |
| 191 "Sync Backend Initialized"); | 192 "Sync Backend Initialized"); |
| 192 BoolSyncStat is_syncing(section_local, "Syncing"); | 193 BoolSyncStat is_syncing(section_local, "Syncing"); |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 const syncer::sessions::SyncSessionSnapshot& snapshot = | 283 const syncer::sessions::SyncSessionSnapshot& snapshot = |
| 283 sync_initialized ? | 284 sync_initialized ? |
| 284 service->GetLastSessionSnapshot() : | 285 service->GetLastSessionSnapshot() : |
| 285 syncer::sessions::SyncSessionSnapshot(); | 286 syncer::sessions::SyncSessionSnapshot(); |
| 286 | 287 |
| 287 if (is_status_valid) | 288 if (is_status_valid) |
| 288 summary_string.SetValue(service->QuerySyncStatusSummary()); | 289 summary_string.SetValue(service->QuerySyncStatusSummary()); |
| 289 | 290 |
| 290 server_url.SetValue(service->sync_service_url().spec()); | 291 server_url.SetValue(service->sync_service_url().spec()); |
| 291 | 292 |
| 292 if (is_status_valid && !full_status.unique_id.empty()) | 293 if (is_status_valid && !full_status.sync_id.empty()) |
| 293 client_id.SetValue(full_status.unique_id); | 294 sync_id.SetValue(full_status.sync_id); |
| 295 if (is_status_valid && !full_status.invalidator_client_id.empty()) |
| 296 invalidator_id.SetValue(full_status.invalidator_client_id); |
| 294 if (service->signin()) | 297 if (service->signin()) |
| 295 username.SetValue(service->signin()->GetAuthenticatedUsername()); | 298 username.SetValue(service->signin()->GetAuthenticatedUsername()); |
| 296 is_token_available.SetValue(service->IsSyncTokenAvailable()); | 299 is_token_available.SetValue(service->IsSyncTokenAvailable()); |
| 297 | 300 |
| 298 last_synced.SetValue(service->GetLastSyncedTimeString()); | 301 last_synced.SetValue(service->GetLastSyncedTimeString()); |
| 299 is_setup_complete.SetValue(service->HasSyncSetupCompleted()); | 302 is_setup_complete.SetValue(service->HasSyncSetupCompleted()); |
| 300 is_backend_initialized.SetValue(sync_initialized); | 303 is_backend_initialized.SetValue(sync_initialized); |
| 301 if (is_status_valid) { | 304 if (is_status_valid) { |
| 302 is_syncing.SetValue(full_status.syncing); | 305 is_syncing.SetValue(full_status.syncing); |
| 303 retry_time.SetValue(GetTimeStr(full_status.retry_time, | 306 retry_time.SetValue(GetTimeStr(full_status.retry_time, |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 about_info->SetString("unrecoverable_error_message", | 435 about_info->SetString("unrecoverable_error_message", |
| 433 unrecoverable_error_message); | 436 unrecoverable_error_message); |
| 434 } | 437 } |
| 435 | 438 |
| 436 about_info->Set("type_status", service->GetTypeStatusMap()); | 439 about_info->Set("type_status", service->GetTypeStatusMap()); |
| 437 | 440 |
| 438 return about_info.Pass(); | 441 return about_info.Pass(); |
| 439 } | 442 } |
| 440 | 443 |
| 441 } // namespace sync_ui_util | 444 } // namespace sync_ui_util |
| OLD | NEW |