| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/sync_ui_util.h" | 5 #include "chrome/browser/sync/sync_ui_util.h" |
| 6 | 6 |
| 7 #include "base/i18n/number_formatting.h" | 7 #include "base/i18n/number_formatting.h" |
| 8 #include "base/i18n/time_formatting.h" | 8 #include "base/i18n/time_formatting.h" |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/browser/profiles/profile_manager.h" | 12 #include "chrome/browser/profiles/profile_manager.h" |
| 13 #include "chrome/browser/sync/profile_sync_service.h" | 13 #include "chrome/browser/sync/profile_sync_service.h" |
| 14 #include "chrome/browser/sync/protocol/proto_enum_conversions.h" | 14 #include "chrome/browser/sync/protocol/proto_enum_conversions.h" |
| 15 #include "chrome/browser/sync/syncable/model_type.h" |
| 15 #include "chrome/browser/sync/sessions/session_state.h" | 16 #include "chrome/browser/sync/sessions/session_state.h" |
| 16 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 17 #include "chrome/browser/ui/browser_window.h" | 18 #include "chrome/browser/ui/browser_window.h" |
| 18 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
| 19 #include "chrome/common/net/gaia/google_service_auth_error.h" | 20 #include "chrome/common/net/gaia/google_service_auth_error.h" |
| 20 #include "chrome/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
| 21 #include "grit/browser_resources.h" | 22 #include "grit/browser_resources.h" |
| 22 #include "grit/chromium_strings.h" | 23 #include "grit/chromium_strings.h" |
| 23 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
| 24 #include "ui/base/l10n/l10n_util.h" | 25 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 full_status.empty_get_updates); | 419 full_status.empty_get_updates); |
| 419 sync_ui_util::AddIntSyncDetail(details, | 420 sync_ui_util::AddIntSyncDetail(details, |
| 420 "Nonempty GetUpdates", | 421 "Nonempty GetUpdates", |
| 421 full_status.nonempty_get_updates); | 422 full_status.nonempty_get_updates); |
| 422 sync_ui_util::AddIntSyncDetail(details, | 423 sync_ui_util::AddIntSyncDetail(details, |
| 423 "Useless Sync Cycles", | 424 "Useless Sync Cycles", |
| 424 full_status.useless_sync_cycles); | 425 full_status.useless_sync_cycles); |
| 425 sync_ui_util::AddIntSyncDetail(details, | 426 sync_ui_util::AddIntSyncDetail(details, |
| 426 "Useful Sync Cycles", | 427 "Useful Sync Cycles", |
| 427 full_status.useful_sync_cycles); | 428 full_status.useful_sync_cycles); |
| 429 sync_ui_util::AddBoolSyncDetail(details, |
| 430 "Explicit Passphrase", |
| 431 service->IsUsingSecondaryPassphrase()); |
| 432 sync_ui_util::AddBoolSyncDetail(details, |
| 433 "Passphrase Required", |
| 434 service->IsPassphraseRequired()); |
| 435 sync_ui_util::AddBoolSyncDetail(details, |
| 436 "Cryptographer Ready", |
| 437 full_status.cryptographer_ready); |
| 438 sync_ui_util::AddBoolSyncDetail(details, |
| 439 "Cryptographer Has Pending Keys", |
| 440 full_status.crypto_has_pending_keys); |
| 441 sync_ui_util::AddStringSyncDetails(details, |
| 442 "Encrypted Types", |
| 443 syncable::ModelTypeSetToString(full_status.encrypted_types)); |
| 428 | 444 |
| 429 const browser_sync::sessions::SyncSessionSnapshot* snapshot = | 445 const browser_sync::sessions::SyncSessionSnapshot* snapshot = |
| 430 service->sync_initialized() ? | 446 service->sync_initialized() ? |
| 431 service->GetLastSessionSnapshot() : NULL; | 447 service->GetLastSessionSnapshot() : NULL; |
| 432 | 448 |
| 433 // |snapshot| could be NULL if sync is not yet initialized. | 449 // |snapshot| could be NULL if sync is not yet initialized. |
| 434 if (snapshot) { | 450 if (snapshot) { |
| 435 sync_ui_util::AddIntSyncDetail(details, "Download Count (This Session)", | 451 sync_ui_util::AddIntSyncDetail(details, "Download Count (This Session)", |
| 436 snapshot->syncer_status.num_updates_downloaded_total); | 452 snapshot->syncer_status.num_updates_downloaded_total); |
| 437 sync_ui_util::AddIntSyncDetail(details, "Commit Count (This Session)", | 453 sync_ui_util::AddIntSyncDetail(details, "Commit Count (This Session)", |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 DictionaryValue* val = new DictionaryValue; | 487 DictionaryValue* val = new DictionaryValue; |
| 472 val->SetString("model_type", ModelTypeToString(it->first)); | 488 val->SetString("model_type", ModelTypeToString(it->first)); |
| 473 val->SetString("group", ModelSafeGroupToString(it->second)); | 489 val->SetString("group", ModelSafeGroupToString(it->second)); |
| 474 routing_info->Append(val); | 490 routing_info->Append(val); |
| 475 } | 491 } |
| 476 } | 492 } |
| 477 } | 493 } |
| 478 } | 494 } |
| 479 | 495 |
| 480 } // namespace sync_ui_util | 496 } // namespace sync_ui_util |
| OLD | NEW |