1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/common/chrome_version_info.h"
7 #include "base/base_paths.h"
8 #include "base/file_path.h"
9 #include "base/path_service.h"
10 #include "base/string_util.h"
11 #include "chrome/installer/util/install_util.h"
12 #include "chrome/installer/util/google_update_settings.h"
17 std::string
VersionInfo::GetVersionStringModifier() {
18 #if defined(GOOGLE_CHROME_BUILD)
21 if (PathService::Get(base::FILE_MODULE
, &module
)) {
22 bool is_system_install
=
23 !InstallUtil::IsPerUserInstall(module
.value().c_str());
25 GoogleUpdateSettings::GetChromeChannelAndModifiers(is_system_install
,
28 return UTF16ToASCII(channel
);
35 VersionInfo::Channel
VersionInfo::GetChannel() {
36 #if defined(GOOGLE_CHROME_BUILD)
37 std::wstring
channel(L
"unknown");
40 if (PathService::Get(base::FILE_MODULE
, &module
)) {
41 bool is_system_install
=
42 !InstallUtil::IsPerUserInstall(module
.value().c_str());
43 channel
= GoogleUpdateSettings::GetChromeChannel(is_system_install
);
46 if (channel
.empty()) {
47 return CHANNEL_STABLE
;
48 } else if (channel
== L
"beta") {
50 } else if (channel
== L
"dev") {
52 } else if (channel
== L
"canary") {
53 return CHANNEL_CANARY
;
57 return CHANNEL_UNKNOWN
;