diff options
Diffstat (limited to 'chrome/common/chrome_plugin_util.cc')
-rw-r--r-- | chrome/common/chrome_plugin_util.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/chrome/common/chrome_plugin_util.cc b/chrome/common/chrome_plugin_util.cc index 9258d98..405d885 100644 --- a/chrome/common/chrome_plugin_util.cc +++ b/chrome/common/chrome_plugin_util.cc @@ -127,13 +127,15 @@ CPError CPB_GetCommandLineArgumentsCommon(const char* url, std::wstring arguments_w; // Use the same UserDataDir for new launches that we currently have set. - std::wstring user_data_dir = cmd.GetSwitchValue(switches::kUserDataDir); - if (!user_data_dir.empty()) { + FilePath user_data_dir = FilePath::FromWStringHack( + cmd.GetSwitchValue(switches::kUserDataDir)); + if (!user_data_dir.value().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 += std::wstring(L"--") + switches::kUserDataDir + - L"=\"" + user_data_dir + L"\" "; + arguments_w += CommandLine::PrefixedSwitchStringWithValue( + switches::kUserDataDir, + user_data_dir.ToWStringHack()) + L" "; } } @@ -146,7 +148,8 @@ CPError CPB_GetCommandLineArgumentsCommon(const char* url, ReplaceSubstringsAfterOffset(&url_string, 0, ";", ""); ReplaceSubstringsAfterOffset(&url_string, 0, "$", ""); std::wstring url_w = UTF8ToWide(url_string); - arguments_w += std::wstring(L"--") + switches::kApp + L"=\"" + url_w + L"\""; + arguments_w += + CommandLine::PrefixedSwitchStringWithValue(switches::kApp, url_w); *arguments = WideToUTF8(arguments_w); |