Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7240)

Unified Diff: chrome/browser/sync/sync_ui_util.cc

Issue 7013040: Add information about sync session and other useful data to about:sync. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: For review. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/sessions/sync_session.cc ('k') | chrome/browser/sync/syncable/syncable.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8f0eefd1ed374836a765a0dbf1c12d6e2598f4eb 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,36 @@ void ConstructAboutInformation(ProfileSyncService* service,
sync_ui_util::AddIntSyncDetail(details,
"Max Consecutive Errors",
full_status.max_consecutive_errors);
+ sync_ui_util::AddIntSyncDetail(details,
+ "Empty Getupdates",
+ full_status.empty_getupdates);
+ sync_ui_util::AddIntSyncDetail(details,
+ "Nonempty Getupdates",
+ full_status.nonempty_getupdates);
+
+ 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)",
+ 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.
lipalani1 2011/05/13 00:43:54 ACtually holding a transaction is not necessary. M
lipalani1 2011/05/13 01:06:43 Done.
+ sync_ui_util::AddIntSyncDetail(details, "Entries" ,
+ snapshot->num_entries);
+ sync_ui_util::AddBoolSyncDetail(details, "Throttled",
+ snapshot->syncer_status.throttled);
+ }
if (service->unrecoverable_error_detected()) {
strings->Set("unrecoverable_error_detected", new FundamentalValue(true));
« no previous file with comments | « chrome/browser/sync/sessions/sync_session.cc ('k') | chrome/browser/sync/syncable/syncable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698