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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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.
4
5 #include "chrome/common/chrome_version_info.h"
6
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"
13
14 namespace chrome {
15
16 // static
17 std::string VersionInfo::GetVersionStringModifier() {
18 #if defined(GOOGLE_CHROME_BUILD)
19 FilePath module;
20 string16 channel;
21 if (PathService::Get(base::FILE_MODULE, &module)) {
22 bool is_system_install =
23 !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.
24
25 GoogleUpdateSettings::GetChromeChannelAndModifiers(is_system_install,
26 &channel);
27 }
28 return UTF16ToASCII(channel);
29 #else
30 return std::string();
31 #endif
32 }
33
34 // static
35 VersionInfo::Channel VersionInfo::GetChannel() {
36 #if defined(GOOGLE_CHROME_BUILD)
37 std::wstring channel(L"unknown");
38
39 FilePath module;
40 if (PathService::Get(base::FILE_MODULE, &module)) {
41 bool is_system_install =
42 !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.
43 channel = GoogleUpdateSettings::GetChromeChannel(is_system_install);
44 }
45
46 if (channel.empty()) {
47 return CHANNEL_STABLE;
48 } else if (channel == L"beta") {
49 return CHANNEL_BETA;
50 } else if (channel == L"dev") {
51 return CHANNEL_DEV;
52 } else if (channel == L"canary") {
53 return CHANNEL_CANARY;
54 }
55 #endif
56
57 return CHANNEL_UNKNOWN;
58 }
59
60 } // namespace chrome
OLDNEW
« 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