Chromium Code Reviews| Index: chrome/browser/sync/sync_ui_util.cc |
| diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc |
| index 8f60271d6c667139e5eed2955fd66945dd089fb6..02185531b1e21cab6e9166a24f64c1dfeb18fe06 100644 |
| --- a/chrome/browser/sync/sync_ui_util.cc |
| +++ b/chrome/browser/sync/sync_ui_util.cc |
| @@ -11,6 +11,8 @@ |
| #include "base/utf_string_conversions.h" |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/sync/profile_sync_service.h" |
| +#include "chrome/browser/sync/protocol/proto_enum_conversions.h" |
| +#include "chrome/browser/sync/sessions/session_state.h" |
| #include "chrome/browser/ui/browser.h" |
| #include "chrome/browser/ui/browser_window.h" |
| #include "chrome/common/chrome_switches.h" |
| @@ -286,6 +288,14 @@ void AddBoolSyncDetail(ListValue* details, |
| details->Append(val); |
| } |
| +void AddStringSyncDetails(ListValue* details, const std::string& stat_name, |
| + const std::string& stat_value) { |
| + DictionaryValue* val = new DictionaryValue; |
| + val->SetString("stat_name", stat_name); |
| + val->SetString("stat_value", stat_value); |
| + details->Append(val); |
| +} |
| + |
| void AddIntSyncDetail(ListValue* details, const std::string& stat_name, |
| int64 stat_value) { |
| DictionaryValue* val = new DictionaryValue; |
| @@ -398,6 +408,42 @@ void ConstructAboutInformation(ProfileSyncService* service, |
| sync_ui_util::AddIntSyncDetail(details, |
| "Max Consecutive Errors", |
| full_status.max_consecutive_errors); |
| + sync_ui_util::AddIntSyncDetail(details, |
| + "Empty Get Updates", |
|
akalin
2011/05/18 01:06:34
Get Updates -> GetUpdates
|
| + full_status.empty_get_updates); |
| + sync_ui_util::AddIntSyncDetail(details, |
| + "Nonempty Get Updates", |
|
akalin
2011/05/18 01:06:34
Get Updates -> GetUpdates
|
| + full_status.nonempty_get_updates); |
| + sync_ui_util::AddIntSyncDetail(details, |
| + "Useless Syncs", |
|
akalin
2011/05/18 01:06:34
Syncs -> Sync Cycles
|
| + full_status.useless_sync_cycles); |
| + sync_ui_util::AddIntSyncDetail(details, |
| + "Useful Syncs", |
|
akalin
2011/05/18 01:06:34
Syncs -> Sync Cycles
|
| + full_status.useful_sync_cycles); |
| + |
| + const browser_sync::sessions::SyncSessionSnapshot* snapshot = |
| + service->GetLastSessionSnapshot(); |
| + |
| + // |snapshot| could be null if sync is not yet completed. |
| + if (snapshot) { |
| + sync_ui_util::AddIntSyncDetail(details, "Download Count (This Session)", |
|
akalin
2011/05/18 01:06:34
Proper indentation is:
sync_ui_util::AddIntSyncDe
|
| + snapshot->syncer_status.num_updates_downloaded_total); |
| + sync_ui_util::AddIntSyncDetail(details, "Commit Count (This Session)", |
| + snapshot->syncer_status.num_successful_commits); |
| + sync_ui_util::AddStringSyncDetails(details, "Last Sync Source", |
| + browser_sync::GetUpdatesSourceString( |
| + snapshot->source.updates_source)); |
| + |
| + // Print the count of entries from snapshot. Warning: This might be |
| + // slightly out of date if there are client side changes that are yet |
| + // unsynced However if we query the latest count here we will |
| + // have to hold the transaction which means we cannot display this page |
| + // when syncing. |
| + sync_ui_util::AddIntSyncDetail(details, "Entries" , |
| + snapshot->num_entries); |
| + sync_ui_util::AddBoolSyncDetail(details, "Throttled", |
| + snapshot->is_silenced); |
| + } |
| if (service->unrecoverable_error_detected()) { |
| strings->Set("unrecoverable_error_detected", new FundamentalValue(true)); |