diff options
author | thestig <thestig@chromium.org> | 2014-11-12 12:12:40 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-11-12 20:13:02 +0000 |
commit | 1d679eaf4f2f0421781be4896ac7d3a356ec93bf (patch) | |
tree | 7ae94d24a80386fa68781774a65d3918c7bed0a8 /chrome/installer/util | |
parent | 17c209dc32efee8e0b128a72404ea9afb184434b (diff) | |
download | chromium_src-1d679eaf4f2f0421781be4896ac7d3a356ec93bf.zip chromium_src-1d679eaf4f2f0421781be4896ac7d3a356ec93bf.tar.gz chromium_src-1d679eaf4f2f0421781be4896ac7d3a356ec93bf.tar.bz2 |
Cleanup: Replace base::ASCIIToWide with base::ASCIIToUTF16 in chrome/installer.
BUG=23581
Review URL: https://codereview.chromium.org/702053004
Cr-Commit-Position: refs/heads/master@{#303883}
Diffstat (limited to 'chrome/installer/util')
-rw-r--r-- | chrome/installer/util/auto_launch_util.cc | 5 | ||||
-rw-r--r-- | chrome/installer/util/installer_state.cc | 4 | ||||
-rw-r--r-- | chrome/installer/util/installer_state_unittest.cc | 11 | ||||
-rw-r--r-- | chrome/installer/util/self_cleaning_temp_dir_unittest.cc | 9 | ||||
-rw-r--r-- | chrome/installer/util/shell_util.cc | 6 | ||||
-rw-r--r-- | chrome/installer/util/user_experiment.cc | 10 |
6 files changed, 20 insertions, 25 deletions
diff --git a/chrome/installer/util/auto_launch_util.cc b/chrome/installer/util/auto_launch_util.cc index 7ad2315..9ab226d6 100644 --- a/chrome/installer/util/auto_launch_util.cc +++ b/chrome/installer/util/auto_launch_util.cc @@ -19,7 +19,6 @@ #include "crypto/sha2.h" using base::ASCIIToUTF16; -using base::ASCIIToWide; namespace auto_launch_util { @@ -50,8 +49,8 @@ base::string16 ProfileToKeyName(const base::string16& profile_directory) { uint8 hash[16]; crypto::SHA256HashString(input, hash, sizeof(hash)); std::string hash_string = base::HexEncode(hash, sizeof(hash)); - return base::string16(kAutolaunchKeyValue) + ASCIIToWide("_") + - ASCIIToWide(hash_string); + return base::string16(kAutolaunchKeyValue) + ASCIIToUTF16("_") + + ASCIIToUTF16(hash_string); } // Returns whether the Chrome executable specified in |application_path| is set diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc index 37c711a..d204277 100644 --- a/chrome/installer/util/installer_state.cc +++ b/chrome/installer/util/installer_state.cc @@ -240,7 +240,6 @@ void InstallerState::Initialize(const CommandLine& command_line, keep_binaries = true; break; } - } } @@ -582,8 +581,7 @@ bool InstallerState::AreBinariesInUse( base::FilePath InstallerState::GetInstallerDirectory( const Version& version) const { - return target_path().Append(base::ASCIIToWide(version.GetString())) - .Append(kInstallerDir); + return target_path().AppendASCII(version.GetString()).Append(kInstallerDir); } // static diff --git a/chrome/installer/util/installer_state_unittest.cc b/chrome/installer/util/installer_state_unittest.cc index 974cb86..e9a19a4b 100644 --- a/chrome/installer/util/installer_state_unittest.cc +++ b/chrome/installer/util/installer_state_unittest.cc @@ -524,12 +524,11 @@ TEST_F(InstallerStateTest, RemoveOldVersionDirs) { installer_state.target_path().Append(L"1.2.3.4"), installer_state.target_path().Append(L"1.2.3.5"), installer_state.target_path().Append(L"1.2.3.6"), - installer_state.target_path().Append(base::ASCIIToWide(kOldVersion)), - installer_state.target_path().Append( - base::ASCIIToWide(kOldChromeExeVersion)), + installer_state.target_path().AppendASCII(kOldVersion), + installer_state.target_path().AppendASCII(kOldChromeExeVersion), installer_state.target_path().Append(L"2.1.1.0"), - installer_state.target_path().Append(base::ASCIIToWide(kChromeExeVersion)), - installer_state.target_path().Append(base::ASCIIToWide(kNewVersion)), + installer_state.target_path().AppendASCII(kChromeExeVersion), + installer_state.target_path().AppendASCII(kNewVersion), installer_state.target_path().Append(L"3.9.1.1"), }; @@ -705,7 +704,7 @@ class InstallerStateCriticalVersionTest : public ::testing::Test { CommandLine::FromString(L"setup.exe") : CommandLine::FromString( L"setup.exe --critical-update-version=" + - base::ASCIIToWide(version->GetString())); + base::ASCIIToUTF16(version->GetString())); prefs_.reset(new MasterPreferences(cmd_line_)); machine_state_.Initialize(); installer_state_.Initialize(cmd_line_, *prefs_, machine_state_); diff --git a/chrome/installer/util/self_cleaning_temp_dir_unittest.cc b/chrome/installer/util/self_cleaning_temp_dir_unittest.cc index 3dffbd7..64445e69 100644 --- a/chrome/installer/util/self_cleaning_temp_dir_unittest.cc +++ b/chrome/installer/util/self_cleaning_temp_dir_unittest.cc @@ -8,7 +8,6 @@ #include "base/files/file_util.h" #include "base/files/scoped_temp_dir.h" #include "base/strings/string_number_conversions.h" -#include "base/strings/utf_string_conversions.h" #include "chrome/installer/util/self_cleaning_temp_dir.h" #include "testing/gtest/include/gtest/gtest.h" @@ -16,7 +15,7 @@ namespace { // Returns a string of 8 characters consisting of the letter 'R' followed by // seven random hex digits. -std::wstring GetRandomFilename() { +std::string GetRandomFilename() { uint8 data[4]; HCRYPTPROV crypt_ctx = NULL; @@ -34,7 +33,7 @@ std::wstring GetRandomFilename() { // Replace the first digit with the letter 'R' (for "random", get it?). result[0] = 'R'; - return base::ASCIIToWide(result); + return result; } } // namespace @@ -57,7 +56,7 @@ TEST_F(SelfCleaningTempDirTest, TopLevel) { TEST_F(SelfCleaningTempDirTest, TopLevelPlusOne) { base::FilePath base_dir; base::FilePath parent_dir(L"C:\\"); - parent_dir = parent_dir.Append(GetRandomFilename()); + parent_dir = parent_dir.AppendASCII(GetRandomFilename()); SelfCleaningTempDir::GetTopDirToCreate(parent_dir, &base_dir); EXPECT_EQ(parent_dir, base_dir); } @@ -161,7 +160,7 @@ TEST_F(SelfCleaningTempDirTest, LeaveUsedOnDestroy) { EXPECT_TRUE(base::DirectoryExists(temp_dir.path())); // Drop a file somewhere. EXPECT_EQ(arraysize(kHiHon) - 1, - base::WriteFile(parent_temp_dir.Append(GetRandomFilename()), + base::WriteFile(parent_temp_dir.AppendASCII(GetRandomFilename()), kHiHon, arraysize(kHiHon) - 1)); } EXPECT_FALSE(base::DirectoryExists(parent_temp_dir.Append(L"Three"))); diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index fd1a6c3..7d27ed8 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -460,13 +460,13 @@ class RegistryEntry { // strings. entries->push_back(new RegistryEntry(install_info, kReinstallCommand, quoted_exe_path + L" --" + - base::ASCIIToWide(switches::kMakeDefaultBrowser))); + base::ASCIIToUTF16(switches::kMakeDefaultBrowser))); entries->push_back(new RegistryEntry(install_info, L"HideIconsCommand", quoted_exe_path + L" --" + - base::ASCIIToWide(switches::kHideIcons))); + base::ASCIIToUTF16(switches::kHideIcons))); entries->push_back(new RegistryEntry(install_info, L"ShowIconsCommand", quoted_exe_path + L" --" + - base::ASCIIToWide(switches::kShowIcons))); + base::ASCIIToUTF16(switches::kShowIcons))); entries->push_back(new RegistryEntry(install_info, L"IconsVisible", 1)); // Register with Default Programs. diff --git a/chrome/installer/util/user_experiment.cc b/chrome/installer/util/user_experiment.cc index 430fd47..efa6505 100644 --- a/chrome/installer/util/user_experiment.cc +++ b/chrome/installer/util/user_experiment.cc @@ -338,16 +338,16 @@ bool CreateExperimentDetails(int flavor, ExperimentDetails* experiment) { base::string16 locale; GoogleUpdateSettings::GetLanguage(&locale); - if (locale.empty() || (locale == base::ASCIIToWide("en"))) - locale = base::ASCIIToWide("en-US"); + if (locale.empty() || (locale == L"en")) + locale = L"en-US"; base::string16 brand; if (!GoogleUpdateSettings::GetBrand(&brand)) - brand = base::ASCIIToWide(""); // Could still be viable for catch-all rules + brand.clear(); // Could still be viable for catch-all rules for (int i = 0; i < arraysize(kExperiments); ++i) { - if (kExperiments[i].locale != locale && - kExperiments[i].locale != base::ASCIIToWide("*")) + base::string16 experiment_locale = kExperiments[i].locale; + if (experiment_locale != locale && experiment_locale != L"*") continue; std::vector<base::string16> brand_codes; |