diff options
author | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-12 04:08:15 +0000 |
---|---|---|
committer | xiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-12 04:08:15 +0000 |
commit | 4458922b1e6d3b02a63bca68d0b286a5c36052ad (patch) | |
tree | 53d7d2571f04fc951c53f4b198d0c74fd4d8cab2 | |
parent | a5fb1c5db00481df8e2707b1b1ef8ecd4d62559f (diff) | |
download | chromium_src-4458922b1e6d3b02a63bca68d0b286a5c36052ad.zip chromium_src-4458922b1e6d3b02a63bca68d0b286a5c36052ad.tar.gz chromium_src-4458922b1e6d3b02a63bca68d0b286a5c36052ad.tar.bz2 |
Fix Win7 issues for non-default profile:
- Fix case A reported by Satoshi.Matsuzaki where a 2nd icon is created
on launching chromium in non-default profile. This is because the
shortcuts for non-default profile is created with wrong app id. The
old use uses user data dir to generate the app id while the
GetChromiumAppId expects profile path;
- Fix an issue in jump list for non-default profile where the
recently close/most visted pages are always opened in the default
profile because the underlying shortcuts does not have the correct
user-data-dir arguments.
BUG=30414
TEST=Verify case A of Satoshi's comments @5 is fixed; Verify the jump list items are opened with correct profile;
Review URL: http://codereview.chromium.org/547011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@35992 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/jumplist.cc | 8 | ||||
-rw-r--r-- | chrome/browser/user_data_manager.cc | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/chrome/browser/jumplist.cc b/chrome/browser/jumplist.cc index 7456e35..e8d71d0 100644 --- a/chrome/browser/jumplist.cc +++ b/chrome/browser/jumplist.cc @@ -419,7 +419,13 @@ bool UpdateJumpList(const wchar_t* app_id, return false; // Retrieve the command-line switches of this process. - std::wstring chrome_switches; + CommandLine command_line(CommandLine::ARGUMENTS_ONLY); + std::wstring user_data_dir = CommandLine::ForCurrentProcess()-> + GetSwitchValue(switches::kUserDataDir); + if (!user_data_dir.empty()) + command_line.AppendSwitchWithValue(switches::kUserDataDir, user_data_dir); + + std::wstring chrome_switches = command_line.command_line_string(); // We allocate 60% of the given JumpList slots to "most-visited" items // and 40% to "recently-closed" items, respectively. diff --git a/chrome/browser/user_data_manager.cc b/chrome/browser/user_data_manager.cc index 01057be..fc31290 100644 --- a/chrome/browser/user_data_manager.cc +++ b/chrome/browser/user_data_manager.cc @@ -292,6 +292,10 @@ bool UserDataManager::CreateDesktopShortcutForProfile( shortcut_name.append(L".lnk"); file_util::AppendToPath(&shortcut_path, shortcut_name); + // Profile path from user_data_dir. + FilePath profile_path = FilePath(user_data_dir).Append( + chrome::kNotSignedInProfile); + return file_util::CreateShortcutLink( cmd.c_str(), shortcut_path.c_str(), @@ -300,7 +304,7 @@ bool UserDataManager::CreateDesktopShortcutForProfile( NULL, exe_path.c_str(), 0, - ShellIntegration::GetChromiumAppId(FilePath(user_data_dir)).c_str()); + ShellIntegration::GetChromiumAppId(profile_path).c_str()); #else // TODO(port): should probably use freedesktop.org standard for desktop files. NOTIMPLEMENTED(); |