| 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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 client_id(section_credentials, "Client ID"); |
| 183 StringSyncStat username(section_credentials, "Username"); | 183 StringSyncStat username(section_credentials, "Username"); |
| 184 BoolSyncStat is_token_available(section_credentials, "Sync Token Available"); | 184 BoolSyncStat is_token_available(section_credentials, "Sync Token Available"); |
| 185 | 185 |
| 186 ListValue* section_local = AddSection(stats_list, "Local State"); | 186 ListValue* section_local = AddSection(stats_list, "Local State"); |
| 187 StringSyncStat last_synced(section_local, "Last Synced"); | 187 StringSyncStat last_synced(section_local, "Last Synced"); |
| 188 BoolSyncStat is_setup_complete(section_local, | 188 BoolSyncStat is_setup_complete(section_local, |
| 189 "Sync First-Time Setup Complete"); | 189 "Sync First-Time Setup Complete"); |
| 190 BoolSyncStat is_backend_initialized(section_local, | 190 StringSyncStat backend_initialization(section_local, |
| 191 "Sync Backend Initialized"); | 191 "Sync Backend Initialization"); |
| 192 BoolSyncStat is_syncing(section_local, "Syncing"); | 192 BoolSyncStat is_syncing(section_local, "Syncing"); |
| 193 | 193 |
| 194 ListValue* section_network = AddSection(stats_list, "Network"); | 194 ListValue* section_network = AddSection(stats_list, "Network"); |
| 195 BoolSyncStat is_throttled(section_network, "Throttled"); | 195 BoolSyncStat is_throttled(section_network, "Throttled"); |
| 196 StringSyncStat retry_time(section_network, "Retry time (maybe stale)"); | 196 StringSyncStat retry_time(section_network, "Retry time (maybe stale)"); |
| 197 BoolSyncStat are_notifications_enabled(section_network, | 197 BoolSyncStat are_notifications_enabled(section_network, |
| 198 "Notifications Enabled"); | 198 "Notifications Enabled"); |
| 199 | 199 |
| 200 ListValue* section_encryption = AddSection(stats_list, "Encryption"); | 200 ListValue* section_encryption = AddSection(stats_list, "Encryption"); |
| 201 BoolSyncStat is_using_explicit_passphrase(section_encryption, | 201 BoolSyncStat is_using_explicit_passphrase(section_encryption, |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 server_url.SetValue(service->sync_service_url().spec()); | 290 server_url.SetValue(service->sync_service_url().spec()); |
| 291 | 291 |
| 292 if (is_status_valid && !full_status.unique_id.empty()) | 292 if (is_status_valid && !full_status.unique_id.empty()) |
| 293 client_id.SetValue(full_status.unique_id); | 293 client_id.SetValue(full_status.unique_id); |
| 294 if (service->signin()) | 294 if (service->signin()) |
| 295 username.SetValue(service->signin()->GetAuthenticatedUsername()); | 295 username.SetValue(service->signin()->GetAuthenticatedUsername()); |
| 296 is_token_available.SetValue(service->IsSyncTokenAvailable()); | 296 is_token_available.SetValue(service->IsSyncTokenAvailable()); |
| 297 | 297 |
| 298 last_synced.SetValue(service->GetLastSyncedTimeString()); | 298 last_synced.SetValue(service->GetLastSyncedTimeString()); |
| 299 is_setup_complete.SetValue(service->HasSyncSetupCompleted()); | 299 is_setup_complete.SetValue(service->HasSyncSetupCompleted()); |
| 300 is_backend_initialized.SetValue(sync_initialized); | 300 backend_initialization.SetValue( |
| 301 service->GetBackendInitializationStateString()); |
| 301 if (is_status_valid) { | 302 if (is_status_valid) { |
| 302 is_syncing.SetValue(full_status.syncing); | 303 is_syncing.SetValue(full_status.syncing); |
| 303 retry_time.SetValue(GetTimeStr(full_status.retry_time, | 304 retry_time.SetValue(GetTimeStr(full_status.retry_time, |
| 304 "Scheduler is not in backoff or throttled")); | 305 "Scheduler is not in backoff or throttled")); |
| 305 } | 306 } |
| 306 | 307 |
| 307 if (snapshot.is_initialized()) | 308 if (snapshot.is_initialized()) |
| 308 is_throttled.SetValue(snapshot.is_silenced()); | 309 is_throttled.SetValue(snapshot.is_silenced()); |
| 309 if (is_status_valid) { | 310 if (is_status_valid) { |
| 310 are_notifications_enabled.SetValue( | 311 are_notifications_enabled.SetValue( |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 about_info->SetString("unrecoverable_error_message", | 433 about_info->SetString("unrecoverable_error_message", |
| 433 unrecoverable_error_message); | 434 unrecoverable_error_message); |
| 434 } | 435 } |
| 435 | 436 |
| 436 about_info->Set("type_status", service->GetTypeStatusMap()); | 437 about_info->Set("type_status", service->GetTypeStatusMap()); |
| 437 | 438 |
| 438 return about_info.Pass(); | 439 return about_info.Pass(); |
| 439 } | 440 } |
| 440 | 441 |
| 441 } // namespace sync_ui_util | 442 } // namespace sync_ui_util |
| OLD | NEW |