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

Side by Side Diff: chrome/common/chrome_version_info_win.cc

Issue 176843022: Move UTF16ToASCII, remove WideToASCII. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
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"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "base/strings/utf_string_conversions.h"
12 #include "chrome/installer/util/google_update_settings.h" 13 #include "chrome/installer/util/google_update_settings.h"
13 #include "chrome/installer/util/install_util.h" 14 #include "chrome/installer/util/install_util.h"
14 15
15 namespace chrome { 16 namespace chrome {
16 17
17 // static 18 // static
18 std::string VersionInfo::GetVersionStringModifier() { 19 std::string VersionInfo::GetVersionStringModifier() {
19 #if defined(GOOGLE_CHROME_BUILD) 20 #if defined(GOOGLE_CHROME_BUILD)
20 base::FilePath module; 21 base::FilePath module;
21 base::string16 channel; 22 base::string16 channel;
22 if (PathService::Get(base::FILE_MODULE, &module)) { 23 if (PathService::Get(base::FILE_MODULE, &module)) {
23 bool is_system_install = 24 bool is_system_install =
24 !InstallUtil::IsPerUserInstall(module.value().c_str()); 25 !InstallUtil::IsPerUserInstall(module.value().c_str());
25 26
26 GoogleUpdateSettings::GetChromeChannelAndModifiers(is_system_install, 27 GoogleUpdateSettings::GetChromeChannelAndModifiers(is_system_install,
27 &channel); 28 &channel);
28 } 29 }
29 #if defined(ADDRESS_SANITIZER) 30 #if defined(ADDRESS_SANITIZER)
30 if (base::debug::IsBinaryInstrumented()) 31 if (base::debug::IsBinaryInstrumented())
31 channel += L" SyzyASan"; 32 channel += L" SyzyASan";
32 #endif 33 #endif
33 return UTF16ToASCII(channel); 34 return base::UTF16ToASCII(channel);
34 #else 35 #else
35 return std::string(); 36 return std::string();
36 #endif 37 #endif
37 } 38 }
38 39
39 // static 40 // static
40 VersionInfo::Channel VersionInfo::GetChannel() { 41 VersionInfo::Channel VersionInfo::GetChannel() {
41 #if defined(GOOGLE_CHROME_BUILD) 42 #if defined(GOOGLE_CHROME_BUILD)
42 std::wstring channel(L"unknown"); 43 std::wstring channel(L"unknown");
43 44
(...skipping 12 matching lines...) Expand all
56 return CHANNEL_DEV; 57 return CHANNEL_DEV;
57 } else if (channel == L"canary") { 58 } else if (channel == L"canary") {
58 return CHANNEL_CANARY; 59 return CHANNEL_CANARY;
59 } 60 }
60 #endif 61 #endif
61 62
62 return CHANNEL_UNKNOWN; 63 return CHANNEL_UNKNOWN;
63 } 64 }
64 65
65 } // namespace chrome 66 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/upgrade_detector_impl.cc ('k') | chrome/common/custom_handlers/protocol_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698