Commit 9ea3ace6 authored by zea@chromium.org's avatar zea@chromium.org

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
parent a47c8a2c
......@@ -42,6 +42,10 @@ table#routingInfo tr:nth-child(odd) {
<h2>Details</h2>
<table id="aboutDetails">
<tr>
<td>Version</td>
<td jscontent="version"/>
</tr>
<tr>
<td>Authenticated</td>
<td>
......
......@@ -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();
......
......@@ -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.
......
......@@ -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";
}
......
......@@ -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
......
......@@ -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
......@@ -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_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment