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

Unified Diff: chrome/browser/user_data_manager.cc

Issue 660038: Fix issue 32106 (Closed)
Patch Set: Created 10 years, 10 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/user_data_manager.h ('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/user_data_manager.cc
diff --git a/chrome/browser/user_data_manager.cc b/chrome/browser/user_data_manager.cc
index fc312900cc13b2c22b806ac0a4691586baedfeac..7694c88ae904c21193e4924f1a493c66ed27ac14 100644
--- a/chrome/browser/user_data_manager.cc
+++ b/chrome/browser/user_data_manager.cc
@@ -264,13 +264,12 @@ void UserDataManager::GetProfiles(std::vector<std::wstring>* profiles) const {
}
}
-bool UserDataManager::CreateDesktopShortcutForProfile(
+bool UserDataManager::CreateShortcutForProfileInFolder(
+ const FilePath& folder,
const std::wstring& profile_name) const {
#if defined(OS_WIN)
std::wstring exe_path;
- std::wstring shortcut_path;
- if (!PathService::Get(base::FILE_EXE, &exe_path) ||
- !ShellUtil::GetDesktopPath(false, &shortcut_path))
+ if (!PathService::Get(base::FILE_EXE, &exe_path))
return false;
// Working directory.
@@ -290,7 +289,8 @@ bool UserDataManager::CreateDesktopShortcutForProfile(
IDS_START_IN_PROFILE_SHORTCUT_NAME,
profile_name);
shortcut_name.append(L".lnk");
- file_util::AppendToPath(&shortcut_path, shortcut_name);
+
+ std::wstring shortcut_path = folder.Append(shortcut_name).ToWStringHack();
// Profile path from user_data_dir.
FilePath profile_path = FilePath(user_data_dir).Append(
@@ -306,6 +306,20 @@ bool UserDataManager::CreateDesktopShortcutForProfile(
0,
ShellIntegration::GetChromiumAppId(profile_path).c_str());
#else
+ NOTIMPLEMENTED();
+ return false;
+#endif
+}
+
+bool UserDataManager::CreateDesktopShortcutForProfile(
+ const std::wstring& profile_name) const {
+#if defined(OS_WIN)
+ std::wstring desktop_path;
+ if (!ShellUtil::GetDesktopPath(false, &desktop_path))
+ return false;
+
+ return CreateShortcutForProfileInFolder(FilePath(desktop_path), profile_name);
+#else
// TODO(port): should probably use freedesktop.org standard for desktop files.
NOTIMPLEMENTED();
return false;
« no previous file with comments | « chrome/browser/user_data_manager.h ('k') | chrome/browser/views/new_profile_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698