Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(53)

Unified Diff: chrome/common/chrome_version_info_win.cc

Issue 7249003: Move GetVersionStringModifier() and GetChannel() from platform_util_* to chrome_version_info_* (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Move GetVersionStringModifier() and GetChannel() from platform_util_* to chrome_version_info.cc Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/common/chrome_version_info_win.cc
diff --git a/chrome/common/chrome_version_info_win.cc b/chrome/common/chrome_version_info_win.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e00d841f09fcf67b664fc47196e681c376de8455
--- /dev/null
+++ b/chrome/common/chrome_version_info_win.cc
@@ -0,0 +1,60 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/chrome_version_info.h"
+
+#include "base/base_paths.h"
+#include "base/file_path.h"
+#include "base/path_service.h"
+#include "base/string_util.h"
+#include "chrome/installer/util/install_util.h"
+#include "chrome/installer/util/google_update_settings.h"
+
+namespace chrome {
+
+// static
+std::string VersionInfo::GetVersionStringModifier() {
+#if defined(GOOGLE_CHROME_BUILD)
+ FilePath module;
+ string16 channel;
+ if (PathService::Get(base::FILE_MODULE, &module)) {
+ bool is_system_install =
+ !InstallUtil::IsPerUserInstall(module.value().c_str());
tony 2011/06/23 16:54:54 Nit: indent 2 more spaces here
haraken1 2011/06/23 23:57:14 Done.
+
+ GoogleUpdateSettings::GetChromeChannelAndModifiers(is_system_install,
+ &channel);
+ }
+ return UTF16ToASCII(channel);
+#else
+ return std::string();
+#endif
+}
+
+// static
+VersionInfo::Channel VersionInfo::GetChannel() {
+#if defined(GOOGLE_CHROME_BUILD)
+ std::wstring channel(L"unknown");
+
+ FilePath module;
+ if (PathService::Get(base::FILE_MODULE, &module)) {
+ bool is_system_install =
+ !InstallUtil::IsPerUserInstall(module.value().c_str());
tony 2011/06/23 16:54:54 Nit: indent 2 more spaces here
haraken1 2011/06/23 23:57:14 Done.
+ channel = GoogleUpdateSettings::GetChromeChannel(is_system_install);
+ }
+
+ if (channel.empty()) {
+ return CHANNEL_STABLE;
+ } else if (channel == L"beta") {
+ return CHANNEL_BETA;
+ } else if (channel == L"dev") {
+ return CHANNEL_DEV;
+ } else if (channel == L"canary") {
+ return CHANNEL_CANARY;
+ }
+#endif
+
+ return CHANNEL_UNKNOWN;
+}
+
+} // namespace chrome
« chrome/common/chrome_version_info_mac.mm ('K') | « chrome/common/chrome_version_info_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698