OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/base/win/shell.h" | 5 #include "ui/base/win/shell.h" |
6 | 6 |
7 #include <dwmapi.h> | 7 #include <dwmapi.h> |
8 #include <shlobj.h> // Must be before propkey. | 8 #include <shlobj.h> // Must be before propkey. |
9 #include <propkey.h> | 9 #include <propkey.h> |
10 #include <shellapi.h> | 10 #include <shellapi.h> |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 base::win::ScopedComPtr<IPropertyStore> pps; | 106 base::win::ScopedComPtr<IPropertyStore> pps; |
107 if (FAILED(SHGetPropertyStoreForWindow(hwnd, | 107 if (FAILED(SHGetPropertyStoreForWindow(hwnd, |
108 IID_PPV_ARGS(pps.Receive())))) | 108 IID_PPV_ARGS(pps.Receive())))) |
109 return false; | 109 return false; |
110 | 110 |
111 return base::win::SetBooleanValueForPropertyStore( | 111 return base::win::SetBooleanValueForPropertyStore( |
112 pps.Get(), PKEY_AppUserModel_PreventPinning, true); | 112 pps.Get(), PKEY_AppUserModel_PreventPinning, true); |
113 } | 113 } |
114 | 114 |
115 // TODO(calamity): investigate moving this out of the UI thread as COM | 115 // TODO(calamity): investigate moving this out of the UI thread as COM |
116 // operations may spawn nested message loops which can cause issues. | 116 // operations may spawn nested run loops which can cause issues. |
117 void SetAppDetailsForWindow(const base::string16& app_id, | 117 void SetAppDetailsForWindow(const base::string16& app_id, |
118 const base::FilePath& app_icon_path, | 118 const base::FilePath& app_icon_path, |
119 int app_icon_index, | 119 int app_icon_index, |
120 const base::string16& relaunch_command, | 120 const base::string16& relaunch_command, |
121 const base::string16& relaunch_display_name, | 121 const base::string16& relaunch_display_name, |
122 HWND hwnd) { | 122 HWND hwnd) { |
123 DCHECK(hwnd); | 123 DCHECK(hwnd); |
124 | 124 |
125 // This functionality is only available on Win7+. | 125 // This functionality is only available on Win7+. |
126 if (base::win::GetVersion() < base::win::VERSION_WIN7) | 126 if (base::win::GetVersion() < base::win::VERSION_WIN7) |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 // at the same feature level. See bug 426573. | 212 // at the same feature level. See bug 426573. |
213 if (base::win::GetVersion() < base::win::VERSION_WIN7) | 213 if (base::win::GetVersion() < base::win::VERSION_WIN7) |
214 return false; | 214 return false; |
215 // If composition is not enabled, we behave like on XP. | 215 // If composition is not enabled, we behave like on XP. |
216 BOOL enabled = FALSE; | 216 BOOL enabled = FALSE; |
217 return SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled; | 217 return SUCCEEDED(DwmIsCompositionEnabled(&enabled)) && enabled; |
218 } | 218 } |
219 | 219 |
220 } // namespace win | 220 } // namespace win |
221 } // namespace ui | 221 } // namespace ui |
OLD | NEW |