| 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 "components/sync/driver/about_sync_util.h" | 5 #include "components/sync/driver/about_sync_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 13 #include "base/values.h" | 13 #include "base/values.h" |
| 14 #include "components/signin/core/browser/signin_manager_base.h" | 14 #include "components/signin/core/browser/signin_manager_base.h" |
| 15 #include "components/sync/api/time.h" | 15 #include "components/sync/api/time.h" |
| 16 #include "components/sync/driver/sync_service.h" | 16 #include "components/sync/driver/sync_service.h" |
| 17 #include "components/sync/engine/cycle/sync_cycle_snapshot.h" |
| 17 #include "components/sync/engine/sync_status.h" | 18 #include "components/sync/engine/sync_status.h" |
| 18 #include "components/sync/engine/sync_string_conversions.h" | 19 #include "components/sync/engine/sync_string_conversions.h" |
| 19 #include "components/sync/protocol/proto_enum_conversions.h" | 20 #include "components/sync/protocol/proto_enum_conversions.h" |
| 20 #include "components/sync/sessions/sync_session_snapshot.h" | |
| 21 #include "components/version_info/version_info.h" | 21 #include "components/version_info/version_info.h" |
| 22 | 22 |
| 23 using base::DictionaryValue; | 23 using base::DictionaryValue; |
| 24 using base::ListValue; | 24 using base::ListValue; |
| 25 | 25 |
| 26 namespace sync_driver { | 26 namespace sync_driver { |
| 27 | 27 |
| 28 namespace sync_ui_util { | 28 namespace sync_ui_util { |
| 29 | 29 |
| 30 const char kIdentityTitle[] = "Identity"; | 30 const char kIdentityTitle[] = "Identity"; |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 client_version.SetValue(GetVersionString(channel)); | 354 client_version.SetValue(GetVersionString(channel)); |
| 355 | 355 |
| 356 if (!service) { | 356 if (!service) { |
| 357 summary_string.SetValue("Sync service does not exist"); | 357 summary_string.SetValue("Sync service does not exist"); |
| 358 return about_info; | 358 return about_info; |
| 359 } | 359 } |
| 360 | 360 |
| 361 syncer::SyncStatus full_status; | 361 syncer::SyncStatus full_status; |
| 362 bool is_status_valid = service->QueryDetailedSyncStatus(&full_status); | 362 bool is_status_valid = service->QueryDetailedSyncStatus(&full_status); |
| 363 bool sync_active = service->IsSyncActive(); | 363 bool sync_active = service->IsSyncActive(); |
| 364 const syncer::sessions::SyncSessionSnapshot& snapshot = | 364 const syncer::SyncCycleSnapshot& snapshot = service->GetLastCycleSnapshot(); |
| 365 service->GetLastSessionSnapshot(); | |
| 366 | 365 |
| 367 if (is_status_valid) | 366 if (is_status_valid) |
| 368 summary_string.SetValue(service->QuerySyncStatusSummaryString()); | 367 summary_string.SetValue(service->QuerySyncStatusSummaryString()); |
| 369 | 368 |
| 370 server_url.SetValue(service->sync_service_url().spec()); | 369 server_url.SetValue(service->sync_service_url().spec()); |
| 371 | 370 |
| 372 if (is_status_valid && !full_status.sync_id.empty()) | 371 if (is_status_valid && !full_status.sync_id.empty()) |
| 373 sync_id.SetValue(full_status.sync_id); | 372 sync_id.SetValue(full_status.sync_id); |
| 374 if (is_status_valid && !full_status.invalidator_client_id.empty()) | 373 if (is_status_valid && !full_status.invalidator_client_id.empty()) |
| 375 invalidator_id.SetValue(full_status.invalidator_client_id); | 374 invalidator_id.SetValue(full_status.invalidator_client_id); |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 } | 516 } |
| 518 | 517 |
| 519 about_info->Set("type_status", service->GetTypeStatusMap()); | 518 about_info->Set("type_status", service->GetTypeStatusMap()); |
| 520 | 519 |
| 521 return about_info; | 520 return about_info; |
| 522 } | 521 } |
| 523 | 522 |
| 524 } // namespace sync_ui_util | 523 } // namespace sync_ui_util |
| 525 | 524 |
| 526 } // namespace sync_driver | 525 } // namespace sync_driver |
| OLD | NEW |