diff options
author | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-11 00:13:56 +0000 |
---|---|---|
committer | mattm@chromium.org <mattm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-11 00:13:56 +0000 |
commit | 1caa9261639f9275071d172ba2711bb792093d55 (patch) | |
tree | 4b82d5bc2652dfe4f86ed124e6ce4f7bbfaf6e0a /chrome/browser | |
parent | bc1eae2c47e4bda12bf2319ee9547a690870744f (diff) | |
download | chromium_src-1caa9261639f9275071d172ba2711bb792093d55.zip chromium_src-1caa9261639f9275071d172ba2711bb792093d55.tar.gz chromium_src-1caa9261639f9275071d172ba2711bb792093d55.tar.bz2 |
Win: Use different AppUserModelID for SxS installs.
BUG=44572
TEST=see bug
Review URL: http://codereview.chromium.org/2616002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@49477 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/aeropeek_manager.cc | 6 | ||||
-rw-r--r-- | chrome/browser/browser.cc | 3 | ||||
-rw-r--r-- | chrome/browser/shell_integration.h | 2 | ||||
-rw-r--r-- | chrome/browser/shell_integration_unittest.cc | 11 | ||||
-rw-r--r-- | chrome/browser/shell_integration_win.cc | 10 | ||||
-rw-r--r-- | chrome/browser/web_applications/web_app.cc | 4 |
6 files changed, 21 insertions, 15 deletions
diff --git a/chrome/browser/aeropeek_manager.cc b/chrome/browser/aeropeek_manager.cc index e0296c8..b9e6b14 100644 --- a/chrome/browser/aeropeek_manager.cc +++ b/chrome/browser/aeropeek_manager.cc @@ -26,6 +26,7 @@ #include "chrome/browser/tab_contents/thumbnail_generator.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_switches.h" +#include "chrome/installer/util/browser_distribution.h" #include "gfx/gdi_util.h" #include "gfx/icon_util.h" #include "skia/ext/image_operations.h" @@ -244,7 +245,10 @@ class RegisterThumbnailTask : public Task { // that this window is a child of the browser application, i.e. to tell // that this thumbnail window should be displayed when we hover the // browser icon in the taskbar. - win_util::SetAppIdForWindow(chrome::kBrowserAppID, window_); + // TODO(mattm): This should use ShellIntegration::GetChromiumAppId to work + // properly with multiple profiles. + win_util::SetAppIdForWindow( + BrowserDistribution::GetDistribution()->GetBrowserAppId(), window_); // Register this place-holder window to the taskbar as a child of // the browser window and add it to the end of its tab list. diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 9a2e9ad..63fbf03 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -337,8 +337,7 @@ void Browser::CreateBrowserWindow() { // name. See http://crbug.com/7028. win_util::SetAppIdForWindow( type_ & TYPE_APP ? - ShellIntegration::GetAppId(app_name_.c_str(), - profile_->GetPath()) : + ShellIntegration::GetAppId(app_name_, profile_->GetPath()) : ShellIntegration::GetChromiumAppId(profile_->GetPath()), window()->GetNativeHandle()); #endif diff --git a/chrome/browser/shell_integration.h b/chrome/browser/shell_integration.h index 7465e11..670063e 100644 --- a/chrome/browser/shell_integration.h +++ b/chrome/browser/shell_integration.h @@ -97,7 +97,7 @@ class ShellIntegration { // Generates Win7 app id for given app name and profile path. The returned app // id is in the format of "|app_name|[.<profile_id>]". "profile_id" is // appended when user override the default value. - static std::wstring GetAppId(const wchar_t* app_name, + static std::wstring GetAppId(const std::wstring& app_name, const FilePath& profile_path); // Generates Win7 app id for Chromium by calling GetAppId with diff --git a/chrome/browser/shell_integration_unittest.cc b/chrome/browser/shell_integration_unittest.cc index 4776d8d..f17680f 100644 --- a/chrome/browser/shell_integration_unittest.cc +++ b/chrome/browser/shell_integration_unittest.cc @@ -18,7 +18,9 @@ #include "googleurl/src/gurl.h" #include "testing/gtest/include/gtest/gtest.h" -#if defined(OS_LINUX) +#if defined(OS_WIN) +#include "chrome/installer/util/browser_distribution.h" +#elif defined(OS_LINUX) #include "base/env_var.h" #endif // defined(OS_LINUX) @@ -285,7 +287,7 @@ TEST(ShellIntegrationTest, GetDesktopFileContents) { TEST(ShellIntegrationTest, GetChromiumAppIdTest) { // Empty profile path should get chrome::kBrowserAppID FilePath empty_path; - EXPECT_EQ(std::wstring(chrome::kBrowserAppID), + EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId(), ShellIntegration::GetChromiumAppId(empty_path)); // Default profile path should get chrome::kBrowserAppID @@ -293,7 +295,7 @@ TEST(ShellIntegrationTest, GetChromiumAppIdTest) { chrome::GetDefaultUserDataDirectory(&default_user_data_dir); FilePath default_profile_path = default_user_data_dir.Append(chrome::kNotSignedInProfile); - EXPECT_EQ(std::wstring(chrome::kBrowserAppID), + EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId(), ShellIntegration::GetChromiumAppId(default_profile_path)); // Non-default profile path should get chrome::kBrowserAppID joined with @@ -301,7 +303,8 @@ TEST(ShellIntegrationTest, GetChromiumAppIdTest) { FilePath profile_path(FILE_PATH_LITERAL("root")); profile_path = profile_path.Append(FILE_PATH_LITERAL("udd")); profile_path = profile_path.Append(FILE_PATH_LITERAL("User Data - Test")); - EXPECT_EQ(std::wstring(chrome::kBrowserAppID) + L".udd.UserDataTest", + EXPECT_EQ(BrowserDistribution::GetDistribution()->GetBrowserAppId() + + L".udd.UserDataTest", ShellIntegration::GetChromiumAppId(profile_path)); } #endif diff --git a/chrome/browser/shell_integration_win.cc b/chrome/browser/shell_integration_win.cc index 8d3a67a..d7aa86e 100644 --- a/chrome/browser/shell_integration_win.cc +++ b/chrome/browser/shell_integration_win.cc @@ -227,11 +227,10 @@ bool MigrateChromiumShortcutsTask::GetExpectedAppId( app_name = web_app::GenerateApplicationNameFromURL( GURL(command_line.GetSwitchValueASCII(switches::kApp))); } else { - app_name = chrome::kBrowserAppID; + app_name = BrowserDistribution::GetDistribution()->GetBrowserAppId(); } - expected_app_id->assign(ShellIntegration::GetAppId(app_name.c_str(), - profile_path)); + expected_app_id->assign(ShellIntegration::GetAppId(app_name, profile_path)); return true; } @@ -386,7 +385,7 @@ bool ShellIntegration::IsFirefoxDefaultBrowser() { return ff_default; } -std::wstring ShellIntegration::GetAppId(const wchar_t* app_name, +std::wstring ShellIntegration::GetAppId(const std::wstring& app_name, const FilePath& profile_path) { std::wstring app_id(app_name); @@ -402,7 +401,8 @@ std::wstring ShellIntegration::GetAppId(const wchar_t* app_name, } std::wstring ShellIntegration::GetChromiumAppId(const FilePath& profile_path) { - return GetAppId(chrome::kBrowserAppID, profile_path); + return GetAppId(BrowserDistribution::GetDistribution()->GetBrowserAppId(), + profile_path); } void ShellIntegration::MigrateChromiumShortcuts() { diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc index 5b2ecac..e1dc105 100644 --- a/chrome/browser/web_applications/web_app.cc +++ b/chrome/browser/web_applications/web_app.cc @@ -375,7 +375,7 @@ bool CreateShortcutTask::CreateShortcut() { // Generates app id from web app url and profile path. std::wstring app_id = ShellIntegration::GetAppId( - web_app::GenerateApplicationNameFromURL(shortcut_info_.url).c_str(), + web_app::GenerateApplicationNameFromURL(shortcut_info_.url), profile_path_); FilePath shortcut_to_pin; @@ -632,7 +632,7 @@ void UpdateShortcutWorker::UpdateShortcutsOnFileThread() { if (!shortcut_files_.empty()) { // Generates app id from web app url and profile path. std::wstring app_id = ShellIntegration::GetAppId( - web_app::GenerateApplicationNameFromURL(shortcut_info_.url).c_str(), + web_app::GenerateApplicationNameFromURL(shortcut_info_.url), profile_path_); // Sanitize description |