| 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/debug/profiler.h" | 8 #include "base/debug/profiler.h" |
| 9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 if (base::debug::IsBinaryInstrumented()) | 36 if (base::debug::IsBinaryInstrumented()) |
| 37 channel += L" SyzyASan"; | 37 channel += L" SyzyASan"; |
| 38 #endif | 38 #endif |
| 39 return base::UTF16ToASCII(channel); | 39 return base::UTF16ToASCII(channel); |
| 40 #else | 40 #else |
| 41 return std::string(); | 41 return std::string(); |
| 42 #endif | 42 #endif |
| 43 } | 43 } |
| 44 | 44 |
| 45 // static | 45 // static |
| 46 VersionInfo::Channel VersionInfo::GetChannel() { | 46 version_info::Channel VersionInfo::GetChannel() { |
| 47 #if defined(GOOGLE_CHROME_BUILD) | 47 #if defined(GOOGLE_CHROME_BUILD) |
| 48 std::wstring channel(L"unknown"); | 48 std::wstring channel(L"unknown"); |
| 49 | 49 |
| 50 base::FilePath module; | 50 base::FilePath module; |
| 51 if (PathService::Get(base::FILE_MODULE, &module)) { | 51 if (PathService::Get(base::FILE_MODULE, &module)) { |
| 52 bool is_system_install = !InstallUtil::IsPerUserInstall(module); | 52 bool is_system_install = !InstallUtil::IsPerUserInstall(module); |
| 53 channel = GoogleUpdateSettings::GetChromeChannel(is_system_install); | 53 channel = GoogleUpdateSettings::GetChromeChannel(is_system_install); |
| 54 } | 54 } |
| 55 | 55 |
| 56 if (channel.empty()) { | 56 if (channel.empty()) { |
| 57 return CHANNEL_STABLE; | 57 return version_info::Channel::STABLE; |
| 58 } else if (channel == L"beta") { | 58 } else if (channel == L"beta") { |
| 59 return CHANNEL_BETA; | 59 return version_info::Channel::BETA; |
| 60 } else if (channel == L"dev") { | 60 } else if (channel == L"dev") { |
| 61 return CHANNEL_DEV; | 61 return version_info::Channel::DEV; |
| 62 } else if (channel == L"canary") { | 62 } else if (channel == L"canary") { |
| 63 return CHANNEL_CANARY; | 63 return version_info::Channel::CANARY; |
| 64 } | 64 } |
| 65 #endif | 65 #endif |
| 66 | 66 |
| 67 return CHANNEL_UNKNOWN; | 67 return version_info::Channel::UNKNOWN; |
| 68 } | 68 } |
| 69 | 69 |
| 70 } // namespace chrome | 70 } // namespace chrome |
| OLD | NEW |