Chromium Code Reviews| Index: chrome/browser/shell_integration_win.cc |
| diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc |
| index 93f1f2f082444dbec59cb155c432f618a0947800..2d090c00bf8b46fd0fff88fe49d83998f349b933 100644 |
| --- a/chrome/browser/shell_integration_win.cc |
| +++ b/chrome/browser/shell_integration_win.cc |
| @@ -293,10 +293,12 @@ bool GetExpectedAppId(const FilePath& chrome_exe, |
| app_name = UTF8ToUTF16(web_app::GenerateApplicationNameFromExtensionId( |
| command_line.GetSwitchValueASCII(switches::kAppId))); |
| } else { |
| - app_name = BrowserDistribution::GetDistribution()->GetBrowserAppId(); |
| + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| + app_name = ShellUtil::GetAppId(dist, chrome_exe.value()); |
| } |
| - expected_app_id->assign(ShellIntegration::GetAppId(app_name, profile_path)); |
| + expected_app_id->assign( |
| + ShellIntegration::GetProfileAppId(app_name, profile_path)); |
| return true; |
| } |
| @@ -550,8 +552,8 @@ bool ShellIntegration::IsFirefoxDefaultBrowser() { |
| return ff_default; |
| } |
| -string16 ShellIntegration::GetAppId(const string16& app_name, |
| - const FilePath& profile_path) { |
| +string16 ShellIntegration::GetProfileAppId(const string16& app_name, |
| + const FilePath& profile_path) { |
| string16 app_id(app_name); |
| string16 profile_id(GetProfileIdFromPath(profile_path)); |
| @@ -566,8 +568,14 @@ string16 ShellIntegration::GetAppId(const string16& app_name, |
| } |
| string16 ShellIntegration::GetChromiumAppId(const FilePath& profile_path) { |
| - return GetAppId(BrowserDistribution::GetDistribution()->GetBrowserAppId(), |
| - profile_path); |
| + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| + FilePath chrome_exe; |
| + if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { |
| + NOTREACHED(); |
| + return dist->GetBaseAppId(); |
| + } |
| + return GetProfileAppId( |
| + ShellUtil::GetAppId(dist, chrome_exe.value()), profile_path); |
| } |
| string16 ShellIntegration::GetChromiumIconPath() { |
| @@ -597,6 +605,11 @@ void ShellIntegration::MigrateChromiumShortcuts() { |
| bool ShellIntegration::ActivateMetroChrome() { |
| BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| - const string16 app_id(dist->GetBrowserAppId()); |
| + FilePath chrome_exe; |
| + if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { |
| + LOG(DFATAL) << "PathService::Get failed."; |
|
grt (UTC plus 2)
2012/06/15 03:03:03
NOTREACHED();
gab
2012/06/15 19:01:04
Done.
|
| + return false; |
| + } |
| + const string16 app_id(ShellUtil::GetAppId(dist, chrome_exe.value())); |
| return ActivateApplication(app_id); |
| } |