Index: chrome/browser/ui/webui/help/help_utils.cc |
diff --git a/chrome/browser/ui/webui/help/help_utils_chromeos.cc b/chrome/browser/ui/webui/help/help_utils.cc |
similarity index 69% |
rename from chrome/browser/ui/webui/help/help_utils_chromeos.cc |
rename to chrome/browser/ui/webui/help/help_utils.cc |
index 95bb156f4f422630a735bab9c8b7c8b17f7b3f72..ae4a1e49331df88d0df591097fe4303db0fe210f 100644 |
--- a/chrome/browser/ui/webui/help/help_utils_chromeos.cc |
+++ b/chrome/browser/ui/webui/help/help_utils.cc |
@@ -2,12 +2,14 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/browser/ui/webui/help/help_utils_chromeos.h" |
- |
-#include <algorithm> |
+#include "chrome/browser/ui/webui/help/help_utils.h" |
#include "base/logging.h" |
+#include "base/strings/utf_string_conversions.h" |
#include "base/values.h" |
+#include "chrome/common/chrome_version_info.h" |
+ |
+#if defined(OS_CHROMEOS) |
Dan Beam
2014/08/13 02:50:46
i doesn't make a ton of sense to me to rename from
michaelpg
2014/08/13 08:12:11
ok. This might as well go in help_utils_chromes an
|
#include "chrome/browser/chromeos/settings/cros_settings.h" |
#include "chromeos/network/network_type_pattern.h" |
#include "chromeos/settings/cros_settings_names.h" |
@@ -15,15 +17,42 @@ |
#include "grit/generated_resources.h" |
#include "third_party/cros_system_api/dbus/service_constants.h" |
#include "ui/base/l10n/l10n_util.h" |
+#endif |
+#if defined(OS_CHROMEOS) |
namespace { |
const bool kDefaultUpdateOverCellularAllowed = false; |
} // namespace |
+#endif |
+ |
+namespace help_utils { |
+ |
+base::string16 BuildBrowserVersionString() { |
+ chrome::VersionInfo version_info; |
+ DCHECK(version_info.is_valid()); |
-namespace help_utils_chromeos { |
+ std::string browser_version = version_info.Version(); |
+ std::string version_modifier = |
+ chrome::VersionInfo::GetVersionStringModifier(); |
+ if (!version_modifier.empty()) |
+ browser_version += " " + version_modifier; |
+ |
+#if !defined(GOOGLE_CHROME_BUILD) |
+ browser_version += " ("; |
+ browser_version += version_info.LastChange(); |
+ browser_version += ")"; |
+#endif |
+ |
+#if defined(ARCH_CPU_64_BITS) |
+ browser_version += " (64-bit)"; |
+#endif |
+ |
+ return base::UTF8ToUTF16(browser_version); |
+} |
+#if defined(OS_CHROMEOS) |
bool IsUpdateOverCellularAllowed() { |
chromeos::CrosSettings* settings = chromeos::CrosSettings::Get(); |
if (!settings) |
@@ -63,5 +92,6 @@ base::string16 GetConnectionTypeAsUTF16(const std::string& type) { |
NOTREACHED(); |
return base::string16(); |
} |
+#endif // OS_CHROMEOS |
-} // namespace help_utils_chromeos |
+} // namespace help_utils |