diff options
author | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-28 12:14:22 +0000 |
---|---|---|
committer | battre@chromium.org <battre@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-28 12:14:22 +0000 |
commit | bcaa7d6f529da7400eae902babffaaeef48ddb54 (patch) | |
tree | 2b4cb25cf770d811b62fabdf3bcd898a6e0f5abb /ui/base/win/shell.cc | |
parent | 10b0bafe6125e7f81d484eb545a383b6d3441b00 (diff) | |
download | chromium_src-bcaa7d6f529da7400eae902babffaaeef48ddb54.zip chromium_src-bcaa7d6f529da7400eae902babffaaeef48ddb54.tar.gz chromium_src-bcaa7d6f529da7400eae902babffaaeef48ddb54.tar.bz2 |
Revert 231295 "Enable profile pinning by setting browser window ..."
Reverting because it breaks several tests, see crbug.com/312264.
> Enable profile pinning by setting browser window relaunch details
>
> Make it possible to pin shortcuts by setting the relaunch data for each browser window.
>
> BUG=177490,107080,146647
> TEST=Create separate profiles and pin the taskbar icons. Clicking the pinned icons should relaunch chrome with the appropriate profile.
>
> TBR=cpu@chromium.org
>
> Review URL: https://codereview.chromium.org/14122006
TBR=calamity@chromium.org
BUG=312264,177490,107080,146647
Review URL: https://codereview.chromium.org/48573003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231313 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/base/win/shell.cc')
-rw-r--r-- | ui/base/win/shell.cc | 70 |
1 files changed, 36 insertions, 34 deletions
diff --git a/ui/base/win/shell.cc b/ui/base/win/shell.cc index ff1a4ff..0f95537 100644 --- a/ui/base/win/shell.cc +++ b/ui/base/win/shell.cc @@ -22,6 +22,42 @@ namespace ui { namespace win { +namespace { + +void SetAppDetailsForWindow(const string16& app_id, + const string16& app_icon, + const string16& relaunch_command, + const string16& relaunch_display_name, + HWND hwnd) { + // This functionality is only available on Win7+. It also doesn't make sense + // to do this for Chrome Metro. + if (base::win::GetVersion() < base::win::VERSION_WIN7 || + base::win::IsMetroProcess()) + return; + base::win::ScopedComPtr<IPropertyStore> pps; + HRESULT result = SHGetPropertyStoreForWindow( + hwnd, __uuidof(*pps), reinterpret_cast<void**>(pps.Receive())); + if (S_OK == result) { + if (!app_id.empty()) + base::win::SetAppIdForPropertyStore(pps, app_id.c_str()); + if (!app_icon.empty()) { + base::win::SetStringValueForPropertyStore( + pps, PKEY_AppUserModel_RelaunchIconResource, app_icon.c_str()); + } + if (!relaunch_command.empty()) { + base::win::SetStringValueForPropertyStore( + pps, PKEY_AppUserModel_RelaunchCommand, relaunch_command.c_str()); + } + if (!relaunch_display_name.empty()) { + base::win::SetStringValueForPropertyStore( + pps, PKEY_AppUserModel_RelaunchDisplayNameResource, + relaunch_display_name.c_str()); + } + } +} + +} // namespace + // Show the Windows "Open With" dialog box to ask the user to pick an app to // open the file with. bool OpenItemWithExternalApp(const string16& full_path) { @@ -78,40 +114,6 @@ bool PreventWindowFromPinning(HWND hwnd) { pps, PKEY_AppUserModel_PreventPinning, true); } -// TODO(calamity): investigate moving this out of the UI thread as COM -// operations may spawn nested message loops which can cause issues. -void SetAppDetailsForWindow(const string16& app_id, - const string16& app_icon, - const string16& relaunch_command, - const string16& relaunch_display_name, - HWND hwnd) { - // This functionality is only available on Win7+. It also doesn't make sense - // to do this for Chrome Metro. - if (base::win::GetVersion() < base::win::VERSION_WIN7 || - base::win::IsMetroProcess()) - return; - base::win::ScopedComPtr<IPropertyStore> pps; - HRESULT result = SHGetPropertyStoreForWindow( - hwnd, __uuidof(*pps), reinterpret_cast<void**>(pps.Receive())); - if (S_OK == result) { - if (!app_id.empty()) - base::win::SetAppIdForPropertyStore(pps, app_id.c_str()); - if (!app_icon.empty()) { - base::win::SetStringValueForPropertyStore( - pps, PKEY_AppUserModel_RelaunchIconResource, app_icon.c_str()); - } - if (!relaunch_command.empty()) { - base::win::SetStringValueForPropertyStore( - pps, PKEY_AppUserModel_RelaunchCommand, relaunch_command.c_str()); - } - if (!relaunch_display_name.empty()) { - base::win::SetStringValueForPropertyStore( - pps, PKEY_AppUserModel_RelaunchDisplayNameResource, - relaunch_display_name.c_str()); - } - } -} - void SetAppIdForWindow(const string16& app_id, HWND hwnd) { SetAppDetailsForWindow(app_id, string16(), string16(), string16(), hwnd); } |