summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/installer/util')
-rw-r--r--chrome/installer/util/auto_launch_util.cc2
-rw-r--r--chrome/installer/util/google_chrome_distribution.cc21
-rw-r--r--chrome/installer/util/google_update_settings.cc2
-rw-r--r--chrome/installer/util/install_util.cc4
-rw-r--r--chrome/installer/util/installation_state.cc4
-rw-r--r--chrome/installer/util/installer_state.cc6
-rw-r--r--chrome/installer/util/installer_state_unittest.cc20
-rw-r--r--chrome/installer/util/logging_installer.cc2
-rw-r--r--chrome/installer/util/move_tree_work_item_unittest.cc4
-rw-r--r--chrome/installer/util/product_unittest.cc2
-rw-r--r--chrome/installer/util/self_cleaning_temp_dir_unittest.cc2
-rw-r--r--chrome/installer/util/shell_util.cc7
12 files changed, 41 insertions, 35 deletions
diff --git a/chrome/installer/util/auto_launch_util.cc b/chrome/installer/util/auto_launch_util.cc
index 60ef370..953b2d2 100644
--- a/chrome/installer/util/auto_launch_util.cc
+++ b/chrome/installer/util/auto_launch_util.cc
@@ -62,7 +62,7 @@ string16 ProfileToKeyName(const string16& profile_directory) {
crypto::SHA256HashString(input, hash, sizeof(hash));
std::string hash_string = base::HexEncode(hash, sizeof(hash));
return string16(kAutolaunchKeyValue) +
- ASCIIToWide("_") + ASCIIToWide(hash_string);
+ base::ASCIIToWide("_") + base::ASCIIToWide(hash_string);
}
// Returns whether the Chrome executable specified in |application_path| is set
diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc
index 508ce8d..bb58436 100644
--- a/chrome/installer/util/google_chrome_distribution.cc
+++ b/chrome/installer/util/google_chrome_distribution.cc
@@ -300,12 +300,12 @@ bool GoogleChromeDistribution::BuildUninstallMetricsString(
iter.Advance()) {
has_values = true;
metrics->append(L"&");
- metrics->append(UTF8ToWide(iter.key()));
+ metrics->append(base::UTF8ToWide(iter.key()));
metrics->append(L"=");
std::string value;
iter.value().GetAsString(&value);
- metrics->append(UTF8ToWide(value));
+ metrics->append(base::UTF8ToWide(value));
}
return has_values;
@@ -382,7 +382,8 @@ void GoogleChromeDistribution::DoPostUninstallOperations(
iexplore = iexplore.AppendASCII("iexplore.exe");
string16 command = iexplore.value() + L" " + GetUninstallSurveyUrl() +
- L"&" + kVersionParam + L"=" + UTF8ToWide(version.GetString()) + L"&" +
+ L"&" + kVersionParam + L"=" +
+ base::UTF8ToWide(version.GetString()) + L"&" +
kOSParam + L"=" + os_version;
string16 uninstall_metrics;
@@ -660,16 +661,18 @@ bool GoogleChromeDistribution::GetExperimentDetails(
string16 locale;
GoogleUpdateSettings::GetLanguage(&locale);
- if (locale.empty() || (locale == ASCIIToWide("en")))
- locale = ASCIIToWide("en-US");
+ if (locale.empty() || (locale == base::ASCIIToWide("en")))
+ locale = base::ASCIIToWide("en-US");
string16 brand;
- if (!GoogleUpdateSettings::GetBrand(&brand))
- brand = ASCIIToWide(""); // Could still be viable for catch-all rules.
+ if (!GoogleUpdateSettings::GetBrand(&brand)) {
+ // Could still be viable for catch-all rules.
+ brand = base::ASCIIToWide("");
+ }
for (int i = 0; i < arraysize(kExperiments); ++i) {
if (kExperiments[i].locale != locale &&
- kExperiments[i].locale != ASCIIToWide("*"))
+ kExperiments[i].locale != base::ASCIIToWide("*"))
continue;
std::vector<string16> brand_codes;
@@ -808,7 +811,7 @@ void GoogleChromeDistribution::LaunchUserExperiment(
cmd_line.AppendSwitchASCII(installer::switches::kInactiveUserToast,
base::IntToString(flavor));
cmd_line.AppendSwitchASCII(installer::switches::kExperimentGroup,
- WideToASCII(base_group));
+ base::WideToASCII(base_group));
LaunchSetup(&cmd_line, product, system_level);
}
diff --git a/chrome/installer/util/google_update_settings.cc b/chrome/installer/util/google_update_settings.cc
index 4934a50..6a1b7e3 100644
--- a/chrome/installer/util/google_update_settings.cc
+++ b/chrome/installer/util/google_update_settings.cc
@@ -609,7 +609,7 @@ bool GoogleUpdateSettings::GetUpdateDetailForApp(bool system_install,
(clientstate.ReadValue(google_update::kRegVersionField,
&version) == ERROR_SUCCESS)) {
product_found = true;
- data->version = WideToASCII(version);
+ data->version = base::WideToASCII(version);
data->last_success = base::Time::FromTimeT(dword_value);
data->last_result = 0;
data->last_error_code = 0;
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc
index 0c02d71..3ba4955 100644
--- a/chrome/installer/util/install_util.cc
+++ b/chrome/installer/util/install_util.cc
@@ -225,7 +225,7 @@ void InstallUtil::GetChromeVersion(BrowserDistribution* dist,
if (result == ERROR_SUCCESS && !version_str.empty()) {
VLOG(1) << "Existing " << dist->GetAppShortCutName() << " version found "
<< version_str;
- *version = Version(WideToASCII(version_str));
+ *version = Version(base::WideToASCII(version_str));
} else {
DCHECK_EQ(ERROR_FILE_NOT_FOUND, result);
VLOG(1) << "No existing " << dist->GetAppShortCutName()
@@ -251,7 +251,7 @@ void InstallUtil::GetCriticalUpdateVersion(BrowserDistribution* dist,
if (result == ERROR_SUCCESS && !version_str.empty()) {
VLOG(1) << "Critical Update version for " << dist->GetAppShortCutName()
<< " found " << version_str;
- *version = Version(WideToASCII(version_str));
+ *version = Version(base::WideToASCII(version_str));
} else {
DCHECK_EQ(ERROR_FILE_NOT_FOUND, result);
VLOG(1) << "No existing " << dist->GetAppShortCutName()
diff --git a/chrome/installer/util/installation_state.cc b/chrome/installer/util/installation_state.cc
index 43c73ce..7d99063 100644
--- a/chrome/installer/util/installation_state.cc
+++ b/chrome/installer/util/installation_state.cc
@@ -60,7 +60,7 @@ bool ProductState::Initialize(bool system_install,
std::wstring version_str;
if (key.ReadValue(google_update::kRegVersionField,
&version_str) == ERROR_SUCCESS) {
- version_.reset(new Version(WideToASCII(version_str)));
+ version_.reset(new Version(base::WideToASCII(version_str)));
if (!version_->IsValid())
version_.reset();
}
@@ -70,7 +70,7 @@ bool ProductState::Initialize(bool system_install,
// only be accessible via InstallationState::GetNonVersionedProductState.
if (key.ReadValue(google_update::kRegOldVersionField,
&version_str) == ERROR_SUCCESS) {
- old_version_.reset(new Version(WideToASCII(version_str)));
+ old_version_.reset(new Version(base::WideToASCII(version_str)));
if (!old_version_->IsValid())
old_version_.reset();
}
diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc
index 66ffb24..87e14d80 100644
--- a/chrome/installer/util/installer_state.cc
+++ b/chrome/installer/util/installer_state.cc
@@ -599,7 +599,7 @@ bool InstallerState::IsChromeFrameRunning(
base::FilePath InstallerState::GetInstallerDirectory(
const Version& version) const {
- return target_path().Append(ASCIIToWide(version.GetString()))
+ return target_path().Append(base::ASCIIToWide(version.GetString()))
.Append(kInstallerDir);
}
@@ -628,7 +628,7 @@ void InstallerState::GetExistingExeVersions(
if (file_version_info) {
string16 version_string = file_version_info->file_version();
if (!version_string.empty() && IsStringASCII(version_string))
- existing_versions->insert(WideToASCII(version_string));
+ existing_versions->insert(base::WideToASCII(version_string));
}
}
}
@@ -656,7 +656,7 @@ void InstallerState::RemoveOldVersionDirectories(
for (base::FilePath next_version = version_enum.Next(); !next_version.empty();
next_version = version_enum.Next()) {
base::FilePath dir_name(next_version.BaseName());
- version = Version(WideToASCII(dir_name.value()));
+ version = Version(base::WideToASCII(dir_name.value()));
// Delete the version folder if it is less than the new version and not
// equal to the old version (if we have an old version).
if (version.IsValid() &&
diff --git a/chrome/installer/util/installer_state_unittest.cc b/chrome/installer/util/installer_state_unittest.cc
index 5395a84..ca64c97 100644
--- a/chrome/installer/util/installer_state_unittest.cc
+++ b/chrome/installer/util/installer_state_unittest.cc
@@ -276,9 +276,9 @@ TEST_F(InstallerStateTest, Basic) {
EXPECT_FALSE(installer_dir.empty());
base::FilePath new_version_dir(installer_state.target_path().Append(
- UTF8ToWide(new_version.GetString())));
+ base::UTF8ToWide(new_version.GetString())));
base::FilePath old_version_dir(installer_state.target_path().Append(
- UTF8ToWide(old_version.GetString())));
+ base::UTF8ToWide(old_version.GetString())));
EXPECT_FALSE(file_util::PathExists(new_version_dir));
EXPECT_FALSE(file_util::PathExists(old_version_dir));
@@ -361,7 +361,8 @@ TEST_F(InstallerStateTest, WithProduct) {
EXPECT_TRUE(chrome_key.Valid());
if (chrome_key.Valid()) {
chrome_key.WriteValue(google_update::kRegVersionField,
- UTF8ToWide(current_version.GetString()).c_str());
+ base::UTF8ToWide(
+ current_version.GetString()).c_str());
machine_state.Initialize();
// TODO(tommi): Also test for when there exists a new_chrome.exe.
Version found_version(*installer_state.GetCurrentVersion(machine_state));
@@ -532,11 +533,12 @@ TEST_F(InstallerStateTest, MAYBE_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(ASCIIToWide(kOldVersion)),
- installer_state.target_path().Append(ASCIIToWide(kOldChromeExeVersion)),
+ installer_state.target_path().Append(base::ASCIIToWide(kOldVersion)),
+ installer_state.target_path().Append(
+ base::ASCIIToWide(kOldChromeExeVersion)),
installer_state.target_path().Append(L"2.1.1.0"),
- installer_state.target_path().Append(ASCIIToWide(kChromeExeVersion)),
- installer_state.target_path().Append(ASCIIToWide(kNewVersion)),
+ installer_state.target_path().Append(base::ASCIIToWide(kChromeExeVersion)),
+ installer_state.target_path().Append(base::ASCIIToWide(kNewVersion)),
installer_state.target_path().Append(L"3.9.1.1"),
};
@@ -597,7 +599,7 @@ TEST_F(InstallerStateTest, MAYBE_RemoveOldVersionDirs) {
for (base::FilePath next_version = version_enum.Next(); !next_version.empty();
next_version = version_enum.Next()) {
base::FilePath dir_name(next_version.BaseName());
- Version version(WideToASCII(dir_name.value()));
+ Version version(base::WideToASCII(dir_name.value()));
if (version.IsValid()) {
EXPECT_TRUE(expected_remaining_dirs.erase(version.GetString()))
<< "Unexpected version dir found: " << version.GetString();
@@ -643,7 +645,7 @@ class InstallerStateCriticalVersionTest : public ::testing::Test {
CommandLine::FromString(L"setup.exe") :
CommandLine::FromString(
L"setup.exe --critical-update-version=" +
- ASCIIToWide(version->GetString()));
+ base::ASCIIToWide(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/logging_installer.cc b/chrome/installer/util/logging_installer.cc
index adc7801..16666c1 100644
--- a/chrome/installer/util/logging_installer.cc
+++ b/chrome/installer/util/logging_installer.cc
@@ -117,7 +117,7 @@ base::FilePath GetLogFilePath(const installer::MasterPreferences& prefs) {
std::string path;
prefs.GetString(installer::master_preferences::kLogFile, &path);
if (!path.empty()) {
- return base::FilePath(UTF8ToWide(path));
+ return base::FilePath(base::UTF8ToWide(path));
}
std::wstring log_filename = prefs.install_chrome_frame() ?
diff --git a/chrome/installer/util/move_tree_work_item_unittest.cc b/chrome/installer/util/move_tree_work_item_unittest.cc
index bead46e..7a19007 100644
--- a/chrome/installer/util/move_tree_work_item_unittest.cc
+++ b/chrome/installer/util/move_tree_work_item_unittest.cc
@@ -33,7 +33,7 @@ class MoveTreeWorkItemTest : public testing::Test {
void CreateTextFile(const std::wstring& filename,
const std::wstring& contents) {
std::wofstream file;
- file.open(WideToASCII(filename).c_str());
+ file.open(base::WideToASCII(filename).c_str());
ASSERT_TRUE(file.is_open());
file << contents;
file.close();
@@ -43,7 +43,7 @@ void CreateTextFile(const std::wstring& filename,
std::wstring ReadTextFile(const base::FilePath& path) {
WCHAR contents[64];
std::wifstream file;
- file.open(WideToASCII(path.value()).c_str());
+ file.open(base::WideToASCII(path.value()).c_str());
EXPECT_TRUE(file.is_open());
file.getline(contents, arraysize(contents));
file.close();
diff --git a/chrome/installer/util/product_unittest.cc b/chrome/installer/util/product_unittest.cc
index 688af71..64b6f02 100644
--- a/chrome/installer/util/product_unittest.cc
+++ b/chrome/installer/util/product_unittest.cc
@@ -110,7 +110,7 @@ TEST_F(ProductTest, MAYBE_ProductInstallBasic) {
const char kCurrentVersion[] = "1.2.3.4";
Version current_version(kCurrentVersion);
version_key.WriteValue(google_update::kRegVersionField,
- UTF8ToWide(current_version.GetString()).c_str());
+ base::UTF8ToWide(current_version.GetString()).c_str());
// We started out with a non-msi product.
machine_state.Initialize();
diff --git a/chrome/installer/util/self_cleaning_temp_dir_unittest.cc b/chrome/installer/util/self_cleaning_temp_dir_unittest.cc
index 917ab3c..faacea9 100644
--- a/chrome/installer/util/self_cleaning_temp_dir_unittest.cc
+++ b/chrome/installer/util/self_cleaning_temp_dir_unittest.cc
@@ -34,7 +34,7 @@ std::wstring GetRandomFilename() {
// Replace the first digit with the letter 'R' (for "random", get it?).
result[0] = 'R';
- return ASCIIToWide(result);
+ return base::ASCIIToWide(result);
}
} // namespace
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index 0bc6353..17e1c0b 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -370,11 +370,12 @@ class RegistryEntry {
// Note: not using CommandLine since it has ambiguous rules for quoting
// strings.
entries->push_back(new RegistryEntry(install_info, kReinstallCommand,
- quoted_exe_path + L" --" + ASCIIToWide(switches::kMakeDefaultBrowser)));
+ quoted_exe_path + L" --" +
+ base::ASCIIToWide(switches::kMakeDefaultBrowser)));
entries->push_back(new RegistryEntry(install_info, L"HideIconsCommand",
- quoted_exe_path + L" --" + ASCIIToWide(switches::kHideIcons)));
+ quoted_exe_path + L" --" + base::ASCIIToWide(switches::kHideIcons)));
entries->push_back(new RegistryEntry(install_info, L"ShowIconsCommand",
- quoted_exe_path + L" --" + ASCIIToWide(switches::kShowIcons)));
+ quoted_exe_path + L" --" + base::ASCIIToWide(switches::kShowIcons)));
entries->push_back(new RegistryEntry(install_info, L"IconsVisible", 1));
// Register with Default Programs.