Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3000)

Unified Diff: chrome/browser/shell_integration_linux.cc

Issue 271056: Do some cleanup of file path name handling. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/download/save_package.cc ('k') | chrome/browser/views/new_profile_dialog.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/shell_integration_linux.cc
===================================================================
--- chrome/browser/shell_integration_linux.cc (revision 29772)
+++ chrome/browser/shell_integration_linux.cc (working copy)
@@ -303,17 +303,15 @@
FilePath ShellIntegration::GetDesktopShortcutFilename(const GURL& url) {
// Use a prefix, because xdg-desktop-menu requires it.
- std::wstring filename_wide =
- std::wstring(chrome::kBrowserProcessExecutableName) + L"-" +
- UTF8ToWide(url.spec());
- file_util::ReplaceIllegalCharacters(&filename_wide, '_');
+ std::string filename =
+ WideToUTF8(chrome::kBrowserProcessExecutableName) + "-" + url.spec();
+ file_util::ReplaceIllegalCharactersInPath(&filename, '_');
FilePath desktop_path;
if (!PathService::Get(chrome::DIR_USER_DESKTOP, &desktop_path))
return FilePath();
- FilePath filepath = desktop_path.Append(
- FilePath::FromWStringHack(filename_wide));
+ FilePath filepath = desktop_path.Append(filename);
FilePath alternative_filepath(filepath.value() + ".desktop");
for (size_t i = 1; i < 100; ++i) {
if (file_util::PathExists(FilePath(alternative_filepath))) {
« no previous file with comments | « chrome/browser/download/save_package.cc ('k') | chrome/browser/views/new_profile_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698