diff options
author | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-17 06:14:58 +0000 |
---|---|---|
committer | zea@chromium.org <zea@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-17 06:14:58 +0000 |
commit | d0aceba32248239fefd2ae269fe2a40fb838f998 (patch) | |
tree | b8f788bdd6630c8f1a6e5591f2fa8de855bc1f98 /chrome/browser/sync/sync_ui_util.cc | |
parent | a22fb29f22434c8db20c2a4c20dad61ab45b62c0 (diff) | |
download | chromium_src-d0aceba32248239fefd2ae269fe2a40fb838f998.zip chromium_src-d0aceba32248239fefd2ae269fe2a40fb838f998.tar.gz chromium_src-d0aceba32248239fefd2ae269fe2a40fb838f998.tar.bz2 |
[Sync] Add version info to about:sync
Version is in format <Browser Name> <Version> (<OS>) <Channel/Modifier info>
BUG=97158
TEST=verify version info is in about:sync
Review URL: http://codereview.chromium.org/8587017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110456 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/sync/sync_ui_util.cc')
-rw-r--r-- | chrome/browser/sync/sync_ui_util.cc | 30 |
1 files changed, 30 insertions, 0 deletions
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 |