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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 BoolSyncStat is_backend_initialized(section_local, |
191 "Sync Backend Initialized"); | 191 "Sync Backend Initialized"); |
192 BoolSyncStat is_download_complete(section_local, "Initial Download Complete"); | |
193 BoolSyncStat is_syncing(section_local, "Syncing"); | 192 BoolSyncStat is_syncing(section_local, "Syncing"); |
194 | 193 |
195 ListValue* section_network = AddSection(stats_list, "Network"); | 194 ListValue* section_network = AddSection(stats_list, "Network"); |
196 BoolSyncStat is_throttled(section_network, "Throttled"); | 195 BoolSyncStat is_throttled(section_network, "Throttled"); |
197 BoolSyncStat are_notifications_enabled(section_network, | 196 BoolSyncStat are_notifications_enabled(section_network, |
198 "Notifications Enabled"); | 197 "Notifications Enabled"); |
199 | 198 |
200 ListValue* section_encryption = AddSection(stats_list, "Encryption"); | 199 ListValue* section_encryption = AddSection(stats_list, "Encryption"); |
201 BoolSyncStat is_using_explicit_passphrase(section_encryption, | 200 BoolSyncStat is_using_explicit_passphrase(section_encryption, |
202 "Explicit Passphrase"); | 201 "Explicit Passphrase"); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 if (is_status_valid && !full_status.unique_id.empty()) | 291 if (is_status_valid && !full_status.unique_id.empty()) |
293 client_id.SetValue(full_status.unique_id); | 292 client_id.SetValue(full_status.unique_id); |
294 if (service->signin()) | 293 if (service->signin()) |
295 username.SetValue(service->signin()->GetAuthenticatedUsername()); | 294 username.SetValue(service->signin()->GetAuthenticatedUsername()); |
296 is_token_available.SetValue(service->IsSyncTokenAvailable()); | 295 is_token_available.SetValue(service->IsSyncTokenAvailable()); |
297 | 296 |
298 last_synced.SetValue(service->GetLastSyncedTimeString()); | 297 last_synced.SetValue(service->GetLastSyncedTimeString()); |
299 is_setup_complete.SetValue(service->HasSyncSetupCompleted()); | 298 is_setup_complete.SetValue(service->HasSyncSetupCompleted()); |
300 is_backend_initialized.SetValue(sync_initialized); | 299 is_backend_initialized.SetValue(sync_initialized); |
301 if (is_status_valid) { | 300 if (is_status_valid) { |
302 is_download_complete.SetValue(full_status.initial_sync_ended); | |
303 is_syncing.SetValue(full_status.syncing); | 301 is_syncing.SetValue(full_status.syncing); |
304 } | 302 } |
305 | 303 |
306 if (snapshot.is_initialized()) | 304 if (snapshot.is_initialized()) |
307 is_throttled.SetValue(snapshot.is_silenced()); | 305 is_throttled.SetValue(snapshot.is_silenced()); |
308 if (is_status_valid) { | 306 if (is_status_valid) { |
309 are_notifications_enabled.SetValue( | 307 are_notifications_enabled.SetValue( |
310 full_status.notifications_enabled); | 308 full_status.notifications_enabled); |
311 } | 309 } |
312 | 310 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
431 about_info->SetString("unrecoverable_error_message", | 429 about_info->SetString("unrecoverable_error_message", |
432 unrecoverable_error_message); | 430 unrecoverable_error_message); |
433 } | 431 } |
434 | 432 |
435 about_info->Set("type_status", service->GetTypeStatusMap()); | 433 about_info->Set("type_status", service->GetTypeStatusMap()); |
436 | 434 |
437 return about_info.Pass(); | 435 return about_info.Pass(); |
438 } | 436 } |
439 | 437 |
440 } // namespace sync_ui_util | 438 } // namespace sync_ui_util |
OLD | NEW |