Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2227)

Unified Diff: ui/base/win/shell.cc

Issue 23146009: [WIN] Remove "Pin this program to taskbar" of panel window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/win/shell.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/win/shell.cc
diff --git a/ui/base/win/shell.cc b/ui/base/win/shell.cc
index df90108ac4fb86d451aa63ea37fbd3b57f3a108b..0f955375e527ce189d0a5431085591f97199f931 100644
--- a/ui/base/win/shell.cc
+++ b/ui/base/win/shell.cc
@@ -98,6 +98,22 @@ bool OpenItemViaShellNoZoneCheck(const base::FilePath& full_path) {
SEE_MASK_NOZONECHECKS | SEE_MASK_FLAG_DDEWAIT);
}
+bool PreventWindowFromPinning(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 false;
+ base::win::ScopedComPtr<IPropertyStore> pps;
+ HRESULT result = SHGetPropertyStoreForWindow(
+ hwnd, __uuidof(*pps), reinterpret_cast<void**>(pps.Receive()));
+ if (FAILED(result))
+ return false;
+
+ return base::win::SetBooleanValueForPropertyStore(
+ pps, PKEY_AppUserModel_PreventPinning, true);
+}
+
void SetAppIdForWindow(const string16& app_id, HWND hwnd) {
SetAppDetailsForWindow(app_id, string16(), string16(), string16(), hwnd);
}
« no previous file with comments | « ui/base/win/shell.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698