Index: chrome/browser/shell_integration_win.cc |
diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc |
index 874faaabdcb673eb766ef40fe1f65622aea1bdd6..3726f0220e6410aad81fb134c8c8e06802d986b6 100644 |
--- a/chrome/browser/shell_integration_win.cc |
+++ b/chrome/browser/shell_integration_win.cc |
@@ -41,6 +41,8 @@ using content::BrowserThread; |
namespace { |
+const wchar_t kAppListAppName[] = L"ChromeAppList"; |
+ |
// Helper function for ShellIntegration::GetAppId to generates profile id |
// from profile path. "profile_id" is composed of sanitized basenames of |
// user data dir and profile dir joined by a ".". |
@@ -125,6 +127,10 @@ bool GetExpectedAppId(const FilePath& chrome_exe, |
CommandLine command_line = CommandLine::FromString(base::StringPrintf( |
L"\"%ls\" %ls", source.c_str(), arguments.c_str())); |
+ // TODO(benwells): Update this to use a profile from the command line if it |
+ // is specified. This will fix pinning multi-profile windows (except their |
+ // icon) and also pinning apps, which use a profile flag to run in the correct |
+ // profile. |
FilePath profile_path; |
if (command_line.HasSwitch(switches::kUserDataDir)) { |
profile_path = |
@@ -139,6 +145,8 @@ bool GetExpectedAppId(const FilePath& chrome_exe, |
} else if (command_line.HasSwitch(switches::kAppId)) { |
app_name = UTF8ToUTF16(web_app::GenerateApplicationNameFromExtensionId( |
command_line.GetSwitchValueASCII(switches::kAppId))); |
+ } else if (command_line.HasSwitch(switches::kShowAppList)) { |
+ app_name = kAppListAppName; |
} else { |
BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
app_name = ShellUtil::GetBrowserModelId( |
@@ -411,6 +419,12 @@ string16 ShellIntegration::GetChromiumModelIdForProfile( |
profile_path); |
} |
+string16 ShellIntegration::GetAppListAppModelIdForProfile( |
+ const FilePath& profile_path) { |
+ return ShellIntegration::GetAppModelIdForProfile(kAppListAppName, |
+ profile_path); |
+} |
+ |
string16 ShellIntegration::GetChromiumIconPath() { |
// Determine the app path. If we can't determine what that is, we have |
// bigger fish to fry... |