Explicitly add python-numpy dependency to install-build-deps.
[chromium-blink-merge.git] / chrome / common / chrome_version_info_win.cc
blobd692c5e0ac075b18fe1fe27955c916a8d111d5e0
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/debug/profiler.h"
9 #include "base/files/file_path.h"
10 #include "base/path_service.h"
11 #include "base/profiler/scoped_tracker.h"
12 #include "base/strings/string_util.h"
13 #include "base/strings/utf_string_conversions.h"
14 #include "chrome/installer/util/google_update_settings.h"
15 #include "chrome/installer/util/install_util.h"
17 namespace chrome {
19 // static
20 std::string VersionInfo::GetVersionStringModifier() {
21 tracked_objects::ScopedTracker tracking_profile(
22 FROM_HERE_WITH_EXPLICIT_FUNCTION(
23 "422460 VersionInfo::GetVersionStringModifier"));
25 #if defined(GOOGLE_CHROME_BUILD)
26 base::FilePath module;
27 base::string16 channel;
28 if (PathService::Get(base::FILE_MODULE, &module)) {
29 bool is_system_install =
30 !InstallUtil::IsPerUserInstall(module.value().c_str());
32 GoogleUpdateSettings::GetChromeChannelAndModifiers(is_system_install,
33 &channel);
35 #if defined(SYZYASAN)
36 if (base::debug::IsBinaryInstrumented())
37 channel += L" SyzyASan";
38 #endif
39 return base::UTF16ToASCII(channel);
40 #else
41 return std::string();
42 #endif
45 // static
46 VersionInfo::Channel VersionInfo::GetChannel() {
47 #if defined(GOOGLE_CHROME_BUILD)
48 std::wstring channel(L"unknown");
50 base::FilePath module;
51 if (PathService::Get(base::FILE_MODULE, &module)) {
52 bool is_system_install =
53 !InstallUtil::IsPerUserInstall(module.value().c_str());
54 channel = GoogleUpdateSettings::GetChromeChannel(is_system_install);
57 if (channel.empty()) {
58 return CHANNEL_STABLE;
59 } else if (channel == L"beta") {
60 return CHANNEL_BETA;
61 } else if (channel == L"dev") {
62 return CHANNEL_DEV;
63 } else if (channel == L"canary") {
64 return CHANNEL_CANARY;
66 #endif
68 return CHANNEL_UNKNOWN;
71 } // namespace chrome