summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-09 21:03:58 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-09 21:03:58 +0000
commit777d59083eaaa3649903c87fe1f9b79b1e113c2b (patch)
treec1493f35081f8eb5430efdf982b1ab0019355dc1
parent47e4c8793c51d873957c3b6329d020c99f83d1d7 (diff)
downloadchromium_src-777d59083eaaa3649903c87fe1f9b79b1e113c2b.zip
chromium_src-777d59083eaaa3649903c87fe1f9b79b1e113c2b.tar.gz
chromium_src-777d59083eaaa3649903c87fe1f9b79b1e113c2b.tar.bz2
Revert "Remove deprecated AbsolutePath function."
This reverts commit r28593. Random guess at build breakage. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28596 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--base/file_util.cc7
-rw-r--r--base/file_util.h2
-rw-r--r--chrome/common/chrome_plugin_util.cc13
3 files changed, 14 insertions, 8 deletions
diff --git a/base/file_util.cc b/base/file_util.cc
index 37adb04..d3a989b5 100644
--- a/base/file_util.cc
+++ b/base/file_util.cc
@@ -294,6 +294,13 @@ bool ReadFileToString(const std::wstring& path, std::string* contents) {
return ReadFileToString(FilePath::FromWStringHack(path), contents);
}
+bool AbsolutePath(std::wstring* path_str) {
+ FilePath path(FilePath::FromWStringHack(*path_str));
+ if (!AbsolutePath(&path))
+ return false;
+ *path_str = path.ToWStringHack();
+ return true;
+}
void AppendToPath(std::wstring* path, const std::wstring& new_ending) {
if (!path) {
NOTREACHED();
diff --git a/base/file_util.h b/base/file_util.h
index e9f9254..37634b9 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -89,6 +89,8 @@ void AppendToPath(std::wstring* path, const std::wstring& new_ending);
// Convert provided relative path into an absolute path. Returns false on
// error. On POSIX, this function fails if the path does not exist.
bool AbsolutePath(FilePath* path);
+// Deprecated temporary compatibility function.
+bool AbsolutePath(std::wstring* path);
// Returns true if |parent| contains |child|. Both paths are converted to
// absolute paths before doing the comparison.
diff --git a/chrome/common/chrome_plugin_util.cc b/chrome/common/chrome_plugin_util.cc
index 405d885..9258d98 100644
--- a/chrome/common/chrome_plugin_util.cc
+++ b/chrome/common/chrome_plugin_util.cc
@@ -127,15 +127,13 @@ CPError CPB_GetCommandLineArgumentsCommon(const char* url,
std::wstring arguments_w;
// Use the same UserDataDir for new launches that we currently have set.
- FilePath user_data_dir = FilePath::FromWStringHack(
- cmd.GetSwitchValue(switches::kUserDataDir));
- if (!user_data_dir.value().empty()) {
+ std::wstring user_data_dir = cmd.GetSwitchValue(switches::kUserDataDir);
+ if (!user_data_dir.empty()) {
// Make sure user_data_dir is an absolute path.
if (file_util::AbsolutePath(&user_data_dir) &&
file_util::PathExists(user_data_dir)) {
- arguments_w += CommandLine::PrefixedSwitchStringWithValue(
- switches::kUserDataDir,
- user_data_dir.ToWStringHack()) + L" ";
+ arguments_w += std::wstring(L"--") + switches::kUserDataDir +
+ L"=\"" + user_data_dir + L"\" ";
}
}
@@ -148,8 +146,7 @@ CPError CPB_GetCommandLineArgumentsCommon(const char* url,
ReplaceSubstringsAfterOffset(&url_string, 0, ";", "");
ReplaceSubstringsAfterOffset(&url_string, 0, "$", "");
std::wstring url_w = UTF8ToWide(url_string);
- arguments_w +=
- CommandLine::PrefixedSwitchStringWithValue(switches::kApp, url_w);
+ arguments_w += std::wstring(L"--") + switches::kApp + L"=\"" + url_w + L"\"";
*arguments = WideToUTF8(arguments_w);