summaryrefslogtreecommitdiffstats
path: root/chrome/browser/sync
diff options
context:
space:
mode:
authorzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-17 18:41:40 +0000
committerzea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-17 18:41:40 +0000
commit9ea3ace69bd5579f44931f6d43a54f452def647c (patch)
tree630ea4ed8202a2794a195c08b4d3676f325b8033 /chrome/browser/sync
parenta47c8a2c90fa802a9408d8f6563e2fcbf6914e70 (diff)
downloadchromium_src-9ea3ace69bd5579f44931f6d43a54f452def647c.zip
chromium_src-9ea3ace69bd5579f44931f6d43a54f452def647c.tar.gz
chromium_src-9ea3ace69bd5579f44931f6d43a54f452def647c.tar.bz2
Revert the revert. This change was not the cause of the failures, so relanding.
Revert 110490 - Revert "[Sync] Add version info to about:sync" This reverts r110456. These tests have been failing on the Mac10.6 Sync builder since this was landed: ManyClientBookmarksSyncTest.Sanity ManyClientPasswordsSyncTest.Sanity ManyClientPreferencesSyncTest.Sanity BUG= TEST= Review URL: http://codereview.chromium.org/8590030 TBR=avi@chromium.org Review URL: http://codereview.chromium.org/8585037 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110532 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync')
-rw-r--r--chrome/browser/sync/engine/all_status.cc5
-rw-r--r--chrome/browser/sync/engine/all_status.h2
-rw-r--r--chrome/browser/sync/internal_api/sync_manager.cc1
-rw-r--r--chrome/browser/sync/internal_api/sync_manager.h3
-rw-r--r--chrome/browser/sync/sync_ui_util.cc30
-rw-r--r--chrome/browser/sync/sync_ui_util.h7
6 files changed, 48 insertions, 0 deletions
diff --git a/chrome/browser/sync/engine/all_status.cc b/chrome/browser/sync/engine/all_status.cc
index 05b4f0f..7a0fabe 100644
--- a/chrome/browser/sync/engine/all_status.cc
+++ b/chrome/browser/sync/engine/all_status.cc
@@ -188,6 +188,11 @@ void AllStatus::SetCryptoHasPendingKeys(bool has_pending_keys) {
status_.crypto_has_pending_keys = has_pending_keys;
}
+void AllStatus::SetUniqueId(const std::string& guid) {
+ ScopedStatusLock lock(this);
+ status_.unique_id = guid;
+}
+
ScopedStatusLock::ScopedStatusLock(AllStatus* allstatus)
: allstatus_(allstatus) {
allstatus->mutex_.Acquire();
diff --git a/chrome/browser/sync/engine/all_status.h b/chrome/browser/sync/engine/all_status.h
index d8350e2..d85e73f 100644
--- a/chrome/browser/sync/engine/all_status.h
+++ b/chrome/browser/sync/engine/all_status.h
@@ -47,6 +47,8 @@ class AllStatus : public SyncEngineEventListener {
void SetCryptographerReady(bool ready);
void SetCryptoHasPendingKeys(bool has_pending_keys);
+ void SetUniqueId(const std::string& guid);
+
protected:
// Examines syncer to calculate syncing and the unsynced count,
// and returns a Status with new values.
diff --git a/chrome/browser/sync/internal_api/sync_manager.cc b/chrome/browser/sync/internal_api/sync_manager.cc
index f4fe74f..1719a57 100644
--- a/chrome/browser/sync/internal_api/sync_manager.cc
+++ b/chrome/browser/sync/internal_api/sync_manager.cc
@@ -935,6 +935,7 @@ bool SyncManager::SyncInternal::SignIn(const SyncCredentials& credentials) {
base::Base64Encode(state, &encoded_state);
VLOG(1) << "Read notification state: " << encoded_state;
}
+ allstatus_.SetUniqueId(unique_id);
} else {
LOG(ERROR) << "Could not read notification unique ID/state";
}
diff --git a/chrome/browser/sync/internal_api/sync_manager.h b/chrome/browser/sync/internal_api/sync_manager.h
index 0ad6cc6..3133f78 100644
--- a/chrome/browser/sync/internal_api/sync_manager.h
+++ b/chrome/browser/sync/internal_api/sync_manager.h
@@ -161,6 +161,9 @@ class SyncManager {
syncable::ModelTypeSet encrypted_types;
bool cryptographer_ready;
bool crypto_has_pending_keys;
+
+ // The unique identifer for this client.
+ std::string unique_id;
};
// An interface the embedding application implements to be notified
diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc
index 7264b48..2bfd6c6 100644
--- a/chrome/browser/sync/sync_ui_util.cc
+++ b/chrome/browser/sync/sync_ui_util.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/chrome_version_info.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
#include "chrome/common/url_constants.h"
#include "grit/browser_resources.h"
@@ -491,6 +492,7 @@ void ConstructAboutInformation(ProfileSyncService* service,
ProfileSyncService::BuildSyncStatusSummaryText(
full_status.summary));
+ strings->SetString("version", GetVersionString());
strings->Set("authenticated",
new base::FundamentalValue(full_status.authenticated));
strings->SetString("auth_problem",
@@ -505,6 +507,10 @@ void ConstructAboutInformation(ProfileSyncService* service,
service->sync_initialized());
sync_ui_util::AddBoolSyncDetail(details, "Sync Setup Has Completed",
service->HasSyncSetupCompleted());
+ sync_ui_util::AddStringSyncDetails(
+ details,
+ "Client ID",
+ full_status.unique_id.empty() ? "none" : full_status.unique_id);
sync_ui_util::AddBoolSyncDetail(details,
"Server Up",
full_status.server_up);
@@ -663,4 +669,28 @@ void ConstructAboutInformation(ProfileSyncService* service,
}
}
+std::string GetVersionString() {
+ // Build a version string that matches MakeUserAgentForSyncApi with the
+ // addition of channel info and proper OS names.
+ chrome::VersionInfo chrome_version;
+ if (!chrome_version.is_valid())
+ return "invalid";
+ // GetVersionStringModifier returns empty string for stable channel or
+ // unofficial builds, the channel string otherwise. We want to have "-devel"
+ // for unofficial builds only.
+ std::string version_modifier =
+ chrome::VersionInfo::GetVersionStringModifier();
+ if (version_modifier.empty()) {
+ if (chrome::VersionInfo::GetChannel() !=
+ chrome::VersionInfo::CHANNEL_STABLE) {
+ version_modifier = "-devel";
+ }
+ } else {
+ version_modifier = " " + version_modifier;
+ }
+ return chrome_version.Name() + " " + chrome_version.OSType() + " " +
+ chrome_version.Version() + " (" + chrome_version.LastChange() + ")" +
+ version_modifier;
+}
+
} // namespace sync_ui_util
diff --git a/chrome/browser/sync/sync_ui_util.h b/chrome/browser/sync/sync_ui_util.h
index 2ded4eb..3498a63 100644
--- a/chrome/browser/sync/sync_ui_util.h
+++ b/chrome/browser/sync/sync_ui_util.h
@@ -83,5 +83,12 @@ void AddIntSyncDetail(base::ListValue* details,
void AddStringSyncDetails(ListValue* details, const std::string& stat_name,
const std::string& stat_value);
+// Returns a string describing the chrome version environment. Version format:
+// <Build Info> <OS> <Version number> (<Last change>)<channel or "-devel">
+// If version information is unavailable, returns "invalid."
+// TODO(zea): this approximately matches MakeUserAgentForSyncApi in
+// sync_backend_host.cc. Unify the two if possible.
+std::string GetVersionString();
+
} // namespace sync_ui_util
#endif // CHROME_BROWSER_SYNC_SYNC_UI_UTIL_H_