OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "app/win/shell.h" | 5 #include "ui/base/win/shell.h" |
6 | 6 |
7 #include <shellapi.h> | 7 #include <shellapi.h> |
8 #include <shlobj.h> | 8 #include <shlobj.h> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/native_library.h" | 11 #include "base/native_library.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "base/win/scoped_comptr.h" | 13 #include "base/win/scoped_comptr.h" |
14 #include "base/win/win_util.h" | 14 #include "base/win/win_util.h" |
15 #include "base/win/windows_version.h" | 15 #include "base/win/windows_version.h" |
16 | 16 |
17 namespace app { | 17 namespace ui { |
18 namespace win { | 18 namespace win { |
19 | 19 |
20 namespace { | 20 namespace { |
21 | 21 |
22 const wchar_t kShell32[] = L"shell32.dll"; | 22 const wchar_t kShell32[] = L"shell32.dll"; |
23 const char kSHGetPropertyStoreForWindow[] = "SHGetPropertyStoreForWindow"; | 23 const char kSHGetPropertyStoreForWindow[] = "SHGetPropertyStoreForWindow"; |
24 | 24 |
25 // Define the type of SHGetPropertyStoreForWindow is SHGPSFW. | 25 // Define the type of SHGetPropertyStoreForWindow is SHGPSFW. |
26 typedef DECLSPEC_IMPORT HRESULT (STDAPICALLTYPE *SHGPSFW)(HWND hwnd, | 26 typedef DECLSPEC_IMPORT HRESULT (STDAPICALLTYPE *SHGPSFW)(HWND hwnd, |
27 REFIID riid, | 27 REFIID riid, |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 HRESULT result = SHGetPropertyStoreForWindow( | 102 HRESULT result = SHGetPropertyStoreForWindow( |
103 hwnd, __uuidof(*pps), reinterpret_cast<void**>(pps.Receive())); | 103 hwnd, __uuidof(*pps), reinterpret_cast<void**>(pps.Receive())); |
104 if (S_OK == result) | 104 if (S_OK == result) |
105 base::win::SetAppIdForPropertyStore(pps, app_id.c_str()); | 105 base::win::SetAppIdForPropertyStore(pps, app_id.c_str()); |
106 | 106 |
107 // Cleanup. | 107 // Cleanup. |
108 base::UnloadNativeLibrary(shell32_library); | 108 base::UnloadNativeLibrary(shell32_library); |
109 } | 109 } |
110 | 110 |
111 } // namespace win | 111 } // namespace win |
112 } // namespace app | 112 } // namespace ui |
OLD | NEW |