| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 281 const syncer::sessions::SyncSessionSnapshot& snapshot = | 282 const syncer::sessions::SyncSessionSnapshot& snapshot = |
| 282 sync_initialized ? | 283 sync_initialized ? |
| 283 service->GetLastSessionSnapshot() : | 284 service->GetLastSessionSnapshot() : |
| 284 syncer::sessions::SyncSessionSnapshot(); | 285 syncer::sessions::SyncSessionSnapshot(); |
| 285 | 286 |
| 286 if (is_status_valid) | 287 if (is_status_valid) |
| 287 summary_string.SetValue(service->QuerySyncStatusSummary()); | 288 summary_string.SetValue(service->QuerySyncStatusSummary()); |
| 288 | 289 |
| 289 server_url.SetValue(service->sync_service_url().spec()); | 290 server_url.SetValue(service->sync_service_url().spec()); |
| 290 | 291 |
| 291 if (is_status_valid && !full_status.unique_id.empty()) | 292 if (is_status_valid && !full_status.sync_id.empty()) |
| 292 client_id.SetValue(full_status.unique_id); | 293 sync_id.SetValue(full_status.sync_id); |
| 294 if (is_status_valid && !full_status.invalidator_client_id.empty()) |
| 295 invalidator_id.SetValue(full_status.invalidator_client_id); |
| 293 if (service->signin()) | 296 if (service->signin()) |
| 294 username.SetValue(service->signin()->GetAuthenticatedUsername()); | 297 username.SetValue(service->signin()->GetAuthenticatedUsername()); |
| 295 is_token_available.SetValue(service->IsSyncTokenAvailable()); | 298 is_token_available.SetValue(service->IsSyncTokenAvailable()); |
| 296 | 299 |
| 297 last_synced.SetValue(service->GetLastSyncedTimeString()); | 300 last_synced.SetValue(service->GetLastSyncedTimeString()); |
| 298 is_setup_complete.SetValue(service->HasSyncSetupCompleted()); | 301 is_setup_complete.SetValue(service->HasSyncSetupCompleted()); |
| 299 is_backend_initialized.SetValue(sync_initialized); | 302 is_backend_initialized.SetValue(sync_initialized); |
| 300 if (is_status_valid) { | 303 if (is_status_valid) { |
| 301 is_syncing.SetValue(full_status.syncing); | 304 is_syncing.SetValue(full_status.syncing); |
| 302 } | 305 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 about_info->SetString("unrecoverable_error_message", | 432 about_info->SetString("unrecoverable_error_message", |
| 430 unrecoverable_error_message); | 433 unrecoverable_error_message); |
| 431 } | 434 } |
| 432 | 435 |
| 433 about_info->Set("type_status", service->GetTypeStatusMap()); | 436 about_info->Set("type_status", service->GetTypeStatusMap()); |
| 434 | 437 |
| 435 return about_info.Pass(); | 438 return about_info.Pass(); |
| 436 } | 439 } |
| 437 | 440 |
| 438 } // namespace sync_ui_util | 441 } // namespace sync_ui_util |
| OLD | NEW |