diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/chrome_plugin_host.cc | 7 | ||||
-rw-r--r-- | chrome/browser/user_data_manager.cc | 17 | ||||
-rw-r--r-- | chrome/common/chrome_constants.cc | 2 | ||||
-rw-r--r-- | chrome/common/chrome_constants.h | 2 | ||||
-rw-r--r-- | chrome/plugin/chrome_plugin_host.cc | 12 |
5 files changed, 24 insertions, 16 deletions
diff --git a/chrome/browser/chrome_plugin_host.cc b/chrome/browser/chrome_plugin_host.cc index 03e23ac..50d9abc 100644 --- a/chrome/browser/chrome_plugin_host.cc +++ b/chrome/browser/chrome_plugin_host.cc @@ -461,9 +461,10 @@ int STDCALL CPB_GetBrowsingContextInfo( PluginService* service = PluginService::GetInstance(); if (!service) return CPERR_FAILURE; - std::wstring wretval = service->GetChromePluginDataDir().ToWStringHack(); - file_util::AppendToPath(&wretval, chrome::kChromePluginDataDirname); - *static_cast<char**>(buf) = CPB_StringDup(CPB_Alloc, WideToUTF8(wretval)); + FilePath path = service->GetChromePluginDataDir(); + std::string retval = WideToUTF8( + path.Append(chrome::kChromePluginDataDirname).ToWStringHack()); + *static_cast<char**>(buf) = CPB_StringDup(CPB_Alloc, retval); return CPERR_SUCCESS; } case CPBROWSINGCONTEXT_UI_LOCALE_PTR: { diff --git a/chrome/browser/user_data_manager.cc b/chrome/browser/user_data_manager.cc index 7694c88..7d9c98a 100644 --- a/chrome/browser/user_data_manager.cc +++ b/chrome/browser/user_data_manager.cc @@ -221,9 +221,10 @@ std::wstring UserDataManager::GetFolderNameFromProfileName( std::wstring UserDataManager::GetUserDataFolderForProfile( const std::wstring& profile_name) const { std::wstring folder_name = GetFolderNameFromProfileName(profile_name); - std::wstring folder_path(user_data_root_); - file_util::AppendToPath(&folder_path, folder_name); - return folder_path; + FilePath folder_path = + FilePath::FromWStringHack(user_data_root_) + .Append(FilePath::FromWStringHack(folder_name)); + return folder_path.ToWStringHack(); } void UserDataManager::LaunchChromeForProfile( @@ -289,8 +290,7 @@ bool UserDataManager::CreateShortcutForProfileInFolder( IDS_START_IN_PROFILE_SHORTCUT_NAME, profile_name); shortcut_name.append(L".lnk"); - - std::wstring shortcut_path = folder.Append(shortcut_name).ToWStringHack(); + FilePath shortcut_path = folder.Append(shortcut_name); // Profile path from user_data_dir. FilePath profile_path = FilePath(user_data_dir).Append( @@ -298,7 +298,7 @@ bool UserDataManager::CreateShortcutForProfileInFolder( return file_util::CreateShortcutLink( cmd.c_str(), - shortcut_path.c_str(), + shortcut_path.value().c_str(), exe_folder.c_str(), args.c_str(), NULL, @@ -306,6 +306,9 @@ bool UserDataManager::CreateShortcutForProfileInFolder( 0, ShellIntegration::GetChromiumAppId(profile_path).c_str()); #else + // TODO(port): should probably use freedesktop.org standard for desktop files. + // See shell_integration.h for an implementation; but this code is reportedly + // obsolete. NOTIMPLEMENTED(); return false; #endif @@ -321,6 +324,8 @@ bool UserDataManager::CreateDesktopShortcutForProfile( return CreateShortcutForProfileInFolder(FilePath(desktop_path), profile_name); #else // TODO(port): should probably use freedesktop.org standard for desktop files. + // See shell_integration.h for an implementation; but this code is reportedly + // obsolete. NOTIMPLEMENTED(); return false; #endif diff --git a/chrome/common/chrome_constants.cc b/chrome/common/chrome_constants.cc index a4278bb..fe4e0fe 100644 --- a/chrome/common/chrome_constants.cc +++ b/chrome/common/chrome_constants.cc @@ -84,7 +84,7 @@ const FilePath::CharType kMediaCacheDirname[] = FPL("Media Cache"); const FilePath::CharType kOffTheRecordMediaCacheDirname[] = FPL("Incognito Media Cache"); const FilePath::CharType kAppCacheDirname[] = FPL("Application Cache"); -const wchar_t kChromePluginDataDirname[] = L"Plugin Data"; +const FilePath::CharType kChromePluginDataDirname[] = FPL("Plugin Data"); const FilePath::CharType kThemePackFilename[] = FPL("Cached Theme.pak"); const FilePath::CharType kCookieFilename[] = FPL("Cookies"); const FilePath::CharType kExtensionsCookieFilename[] = FPL("Extension Cookies"); diff --git a/chrome/common/chrome_constants.h b/chrome/common/chrome_constants.h index cd85a14..0fe7d13 100644 --- a/chrome/common/chrome_constants.h +++ b/chrome/common/chrome_constants.h @@ -40,7 +40,7 @@ extern const FilePath::CharType kCacheDirname[]; extern const FilePath::CharType kMediaCacheDirname[]; extern const FilePath::CharType kOffTheRecordMediaCacheDirname[]; extern const FilePath::CharType kAppCacheDirname[]; -extern const wchar_t kChromePluginDataDirname[]; +extern const FilePath::CharType kChromePluginDataDirname[]; extern const FilePath::CharType kThemePackFilename[]; extern const FilePath::CharType kCookieFilename[]; extern const FilePath::CharType kExtensionsCookieFilename[]; diff --git a/chrome/plugin/chrome_plugin_host.cc b/chrome/plugin/chrome_plugin_host.cc index ab459f4..4561cc4 100644 --- a/chrome/plugin/chrome_plugin_host.cc +++ b/chrome/plugin/chrome_plugin_host.cc @@ -422,11 +422,13 @@ int STDCALL CPB_GetBrowsingContextInfo( if (buf_size < sizeof(char*)) return sizeof(char*); - std::wstring wretval = CommandLine::ForCurrentProcess()-> - GetSwitchValue(switches::kPluginDataDir); - DCHECK(!wretval.empty()); - file_util::AppendToPath(&wretval, chrome::kChromePluginDataDirname); - *static_cast<char**>(buf) = CPB_StringDup(CPB_Alloc, WideToUTF8(wretval)); + FilePath path = CommandLine::ForCurrentProcess()-> + GetSwitchValuePath(switches::kPluginDataDir); + DCHECK(!path.empty()); + std::string retval = WideToUTF8( + path.Append(chrome::kChromePluginDataDirname).ToWStringHack()); + *static_cast<char**>(buf) = CPB_StringDup(CPB_Alloc, retval); + return CPERR_SUCCESS; } case CPBROWSINGCONTEXT_UI_LOCALE_PTR: { |