summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-04 21:15:34 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-08-04 21:15:34 +0000
commitdee7c0509d0e98d1210725aad2ce6e5153780592 (patch)
tree2408eb938674cde03bffb69350171980222d1584 /chrome/installer/util
parentf756abf74be7ce47d482f9760eacb608c9f0e121 (diff)
downloadchromium_src-dee7c0509d0e98d1210725aad2ce6e5153780592.zip
chromium_src-dee7c0509d0e98d1210725aad2ce6e5153780592.tar.gz
chromium_src-dee7c0509d0e98d1210725aad2ce6e5153780592.tar.bz2
Remove GetSwitchValue() from chrome/* where easy.
Review URL: http://codereview.chromium.org/3057033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54966 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util')
-rw-r--r--chrome/installer/util/logging_installer.cc11
-rw-r--r--chrome/installer/util/logging_installer.h3
-rw-r--r--chrome/installer/util/master_preferences.cc8
3 files changed, 12 insertions, 10 deletions
diff --git a/chrome/installer/util/logging_installer.cc b/chrome/installer/util/logging_installer.cc
index 3f11eb5..9dfda73 100644
--- a/chrome/installer/util/logging_installer.cc
+++ b/chrome/installer/util/logging_installer.cc
@@ -29,7 +29,7 @@ void InitInstallerLogging(const CommandLine& command_line) {
return;
}
- logging::InitLogging(GetLogFilePath(command_line).c_str(),
+ logging::InitLogging(GetLogFilePath(command_line).value().c_str(),
logging::LOG_ONLY_TO_FILE,
logging::LOCK_LOG_FILE,
logging::DELETE_OLD_LOG_FILE);
@@ -50,10 +50,10 @@ void EndInstallerLogging() {
installer_logging_ = false;
}
-std::wstring GetLogFilePath(const CommandLine& command_line) {
+FilePath GetLogFilePath(const CommandLine& command_line) {
if (command_line.HasSwitch(
WideToASCII(installer_util::switches::kLogFile))) {
- return command_line.GetSwitchValue(
+ return command_line.GetSwitchValuePath(
WideToASCII(installer_util::switches::kLogFile));
}
@@ -65,12 +65,11 @@ std::wstring GetLogFilePath(const CommandLine& command_line) {
}
FilePath log_path;
-
if (PathService::Get(base::DIR_TEMP, &log_path)) {
log_path = log_path.Append(log_filename);
- return log_path.ToWStringHack();
+ return log_path;
} else {
- return log_filename;
+ return FilePath(log_filename);
}
}
diff --git a/chrome/installer/util/logging_installer.h b/chrome/installer/util/logging_installer.h
index c2b0a96..50882dc 100644
--- a/chrome/installer/util/logging_installer.h
+++ b/chrome/installer/util/logging_installer.h
@@ -11,6 +11,7 @@
#include "base/logging.h"
class CommandLine;
+class FilePath;
namespace installer {
@@ -21,7 +22,7 @@ void InitInstallerLogging(const CommandLine& command_line);
void EndInstallerLogging();
// Returns the full path of the log file.
-std::wstring GetLogFilePath(const CommandLine& command_line);
+FilePath GetLogFilePath(const CommandLine& command_line);
} // namespace installer
diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc
index 053dc45..63967d0 100644
--- a/chrome/installer/util/master_preferences.cc
+++ b/chrome/installer/util/master_preferences.cc
@@ -5,6 +5,7 @@
#include "chrome/installer/util/master_preferences.h"
#include "base/file_util.h"
+#include "base/string_util.h"
#include "base/logging.h"
#include "base/path_service.h"
#include "chrome/common/json_value_serializer.h"
@@ -105,9 +106,10 @@ bool GetDistroIntegerPreference(const DictionaryValue* prefs,
DictionaryValue* GetInstallPreferences(const CommandLine& cmd_line) {
DictionaryValue* prefs = NULL;
#if defined(OS_WIN)
- if (cmd_line.HasSwitch(installer_util::switches::kInstallerData)) {
- FilePath prefs_path(
- cmd_line.GetSwitchValue(installer_util::switches::kInstallerData));
+ std::string installer_data =
+ WideToASCII(installer_util::switches::kInstallerData);
+ if (cmd_line.HasSwitch(installer_data)) {
+ FilePath prefs_path = cmd_line.GetSwitchValuePath(installer_data);
prefs = installer_util::ParseDistributionPreferences(prefs_path);
}