OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/common/chrome_version_info.h" | 5 #include "chrome/common/chrome_version_info.h" |
6 | 6 |
7 #include "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
11 #include "chrome/installer/util/google_update_settings.h" | 11 #include "chrome/installer/util/google_update_settings.h" |
12 #include "chrome/installer/util/install_util.h" | 12 #include "chrome/installer/util/install_util.h" |
13 | 13 |
14 namespace chrome { | 14 namespace chrome { |
15 | 15 |
16 // static | 16 // static |
17 std::string VersionInfo::GetVersionStringModifier() { | 17 std::string VersionInfo::GetVersionStringModifier() { |
18 #if defined(GOOGLE_CHROME_BUILD) | 18 #if defined(GOOGLE_CHROME_BUILD) |
19 base::FilePath module; | 19 base::FilePath module; |
20 string16 channel; | 20 string16 channel; |
21 if (PathService::Get(base::FILE_MODULE, &module)) { | 21 if (PathService::Get(base::FILE_MODULE, &module)) { |
22 bool is_system_install = | 22 bool is_system_install = |
23 !InstallUtil::IsPerUserInstall(module.value().c_str()); | 23 !InstallUtil::IsPerUserInstall(module.value().c_str()); |
24 | 24 |
25 GoogleUpdateSettings::GetChromeChannelAndModifiers(is_system_install, | 25 GoogleUpdateSettings::GetChromeChannelAndModifiers(is_system_install, |
26 &channel); | 26 &channel); |
27 } | 27 } |
28 #if defined(USE_AURA) | |
29 channel += L" Aura"; | |
30 #endif | |
28 return UTF16ToASCII(channel); | 31 return UTF16ToASCII(channel); |
29 #else | 32 #else |
33 #if defined(USE_AURA) | |
jam
2013/04/08 15:32:09
do you really need to change the chromium code pat
| |
34 return "Aura"; | |
35 #else | |
30 return std::string(); | 36 return std::string(); |
31 #endif | 37 #endif |
38 #endif | |
32 } | 39 } |
33 | 40 |
34 // static | 41 // static |
35 VersionInfo::Channel VersionInfo::GetChannel() { | 42 VersionInfo::Channel VersionInfo::GetChannel() { |
36 #if defined(GOOGLE_CHROME_BUILD) | 43 #if defined(GOOGLE_CHROME_BUILD) |
37 std::wstring channel(L"unknown"); | 44 std::wstring channel(L"unknown"); |
38 | 45 |
39 base::FilePath module; | 46 base::FilePath module; |
40 if (PathService::Get(base::FILE_MODULE, &module)) { | 47 if (PathService::Get(base::FILE_MODULE, &module)) { |
41 bool is_system_install = | 48 bool is_system_install = |
42 !InstallUtil::IsPerUserInstall(module.value().c_str()); | 49 !InstallUtil::IsPerUserInstall(module.value().c_str()); |
43 channel = GoogleUpdateSettings::GetChromeChannel(is_system_install); | 50 channel = GoogleUpdateSettings::GetChromeChannel(is_system_install); |
44 } | 51 } |
45 | 52 |
46 if (channel.empty()) { | 53 if (channel.empty()) { |
47 return CHANNEL_STABLE; | 54 return CHANNEL_STABLE; |
48 } else if (channel == L"beta") { | 55 } else if (channel == L"beta") { |
49 return CHANNEL_BETA; | 56 return CHANNEL_BETA; |
50 } else if (channel == L"dev") { | 57 } else if (channel == L"dev") { |
51 return CHANNEL_DEV; | 58 return CHANNEL_DEV; |
52 } else if (channel == L"canary") { | 59 } else if (channel == L"canary") { |
53 return CHANNEL_CANARY; | 60 return CHANNEL_CANARY; |
54 } | 61 } |
55 #endif | 62 #endif |
56 | 63 |
57 return CHANNEL_UNKNOWN; | 64 return CHANNEL_UNKNOWN; |
58 } | 65 } |
59 | 66 |
60 } // namespace chrome | 67 } // namespace chrome |
OLD | NEW |