| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/sync/about_sync_util.h" | 5 #include "chrome/browser/sync/about_sync_util.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 | 136 |
| 137 // Returns a string describing the chrome version environment. Version format: | 137 // Returns a string describing the chrome version environment. Version format: |
| 138 // <Build Info> <OS> <Version number> (<Last change>)<channel or "-devel"> | 138 // <Build Info> <OS> <Version number> (<Last change>)<channel or "-devel"> |
| 139 // If version information is unavailable, returns "invalid." | 139 // If version information is unavailable, returns "invalid." |
| 140 // TODO(zea): this approximately matches MakeUserAgentForSyncApi in | 140 // TODO(zea): this approximately matches MakeUserAgentForSyncApi in |
| 141 // sync_backend_host.cc. Unify the two if possible. | 141 // sync_backend_host.cc. Unify the two if possible. |
| 142 std::string GetVersionString() { | 142 std::string GetVersionString() { |
| 143 // Build a version string that matches MakeUserAgentForSyncApi with the | 143 // Build a version string that matches MakeUserAgentForSyncApi with the |
| 144 // addition of channel info and proper OS names. | 144 // addition of channel info and proper OS names. |
| 145 chrome::VersionInfo chrome_version; | 145 chrome::VersionInfo chrome_version; |
| 146 if (!chrome_version.is_valid()) | |
| 147 return "invalid"; | |
| 148 // GetVersionStringModifier returns empty string for stable channel or | 146 // GetVersionStringModifier returns empty string for stable channel or |
| 149 // unofficial builds, the channel string otherwise. We want to have "-devel" | 147 // unofficial builds, the channel string otherwise. We want to have "-devel" |
| 150 // for unofficial builds only. | 148 // for unofficial builds only. |
| 151 std::string version_modifier = | 149 std::string version_modifier = |
| 152 chrome::VersionInfo::GetVersionStringModifier(); | 150 chrome::VersionInfo::GetVersionStringModifier(); |
| 153 if (version_modifier.empty()) { | 151 if (version_modifier.empty()) { |
| 154 if (chrome::VersionInfo::GetChannel() != | 152 if (chrome::VersionInfo::GetChannel() != |
| 155 chrome::VersionInfo::CHANNEL_STABLE) { | 153 chrome::VersionInfo::CHANNEL_STABLE) { |
| 156 version_modifier = "-devel"; | 154 version_modifier = "-devel"; |
| 157 } | 155 } |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 about_info->SetString("unrecoverable_error_message", | 486 about_info->SetString("unrecoverable_error_message", |
| 489 unrecoverable_error_message); | 487 unrecoverable_error_message); |
| 490 } | 488 } |
| 491 | 489 |
| 492 about_info->Set("type_status", service->GetTypeStatusMap()); | 490 about_info->Set("type_status", service->GetTypeStatusMap()); |
| 493 | 491 |
| 494 return about_info.Pass(); | 492 return about_info.Pass(); |
| 495 } | 493 } |
| 496 | 494 |
| 497 } // namespace sync_ui_util | 495 } // namespace sync_ui_util |
| OLD | NEW |