OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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_util.h" | 5 #include "app/win_util.h" |
6 | 6 |
7 #include <commdlg.h> | 7 #include <commdlg.h> |
8 #include <dwmapi.h> | 8 #include <dwmapi.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 819 matching lines...) Loading... |
830 gfx::Font GetWindowTitleFont() { | 830 gfx::Font GetWindowTitleFont() { |
831 NONCLIENTMETRICS ncm; | 831 NONCLIENTMETRICS ncm; |
832 win_util::GetNonClientMetrics(&ncm); | 832 win_util::GetNonClientMetrics(&ncm); |
833 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); | 833 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); |
834 ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 834 ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
835 return gfx::Font::CreateFont(caption_font); | 835 return gfx::Font::CreateFont(caption_font); |
836 } | 836 } |
837 | 837 |
838 void SetAppIdForWindow(const std::wstring& app_id, HWND hwnd) { | 838 void SetAppIdForWindow(const std::wstring& app_id, HWND hwnd) { |
839 // This functionality is only available on Win7+. | 839 // This functionality is only available on Win7+. |
840 if (win_util::GetWinVersion() != win_util::WINVERSION_WIN7) | 840 if (win_util::GetWinVersion() < win_util::WINVERSION_WIN7) |
841 return; | 841 return; |
842 | 842 |
843 // Load Shell32.dll into memory. | 843 // Load Shell32.dll into memory. |
844 // TODO(brg): Remove this mechanism when the Win7 SDK is available in trunk. | 844 // TODO(brg): Remove this mechanism when the Win7 SDK is available in trunk. |
845 std::wstring shell32_filename(kShell32); | 845 std::wstring shell32_filename(kShell32); |
846 FilePath shell32_filepath(shell32_filename); | 846 FilePath shell32_filepath(shell32_filename); |
847 base::NativeLibrary shell32_library = base::LoadNativeLibrary( | 847 base::NativeLibrary shell32_library = base::LoadNativeLibrary( |
848 shell32_filepath); | 848 shell32_filepath); |
849 | 849 |
850 if (!shell32_library) | 850 if (!shell32_library) |
(...skipping 16 matching lines...) Loading... |
867 hwnd, __uuidof(*pps), reinterpret_cast<void**>(pps.Receive())); | 867 hwnd, __uuidof(*pps), reinterpret_cast<void**>(pps.Receive())); |
868 if (S_OK == result) { | 868 if (S_OK == result) { |
869 SetAppIdForPropertyStore(pps, app_id.c_str()); | 869 SetAppIdForPropertyStore(pps, app_id.c_str()); |
870 } | 870 } |
871 | 871 |
872 // Cleanup. | 872 // Cleanup. |
873 base::UnloadNativeLibrary(shell32_library); | 873 base::UnloadNativeLibrary(shell32_library); |
874 } | 874 } |
875 | 875 |
876 } // namespace win_util | 876 } // namespace win_util |
OLD | NEW |