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 523 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 caption_ptr = localized_caption.c_str(); | 534 caption_ptr = localized_caption.c_str(); |
535 | 535 |
536 return ::MessageBox(hwnd, text_ptr, caption_ptr, actual_flags); | 536 return ::MessageBox(hwnd, text_ptr, caption_ptr, actual_flags); |
537 } | 537 } |
538 | 538 |
539 gfx::Font GetWindowTitleFont() { | 539 gfx::Font GetWindowTitleFont() { |
540 NONCLIENTMETRICS ncm; | 540 NONCLIENTMETRICS ncm; |
541 win_util::GetNonClientMetrics(&ncm); | 541 win_util::GetNonClientMetrics(&ncm); |
542 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); | 542 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); |
543 ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 543 ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
544 return gfx::Font::CreateFont(caption_font); | 544 return gfx::Font(caption_font); |
545 } | 545 } |
546 | 546 |
547 void SetAppIdForWindow(const std::wstring& app_id, HWND hwnd) { | 547 void SetAppIdForWindow(const std::wstring& app_id, HWND hwnd) { |
548 // This functionality is only available on Win7+. | 548 // This functionality is only available on Win7+. |
549 if (win_util::GetWinVersion() < win_util::WINVERSION_WIN7) | 549 if (win_util::GetWinVersion() < win_util::WINVERSION_WIN7) |
550 return; | 550 return; |
551 | 551 |
552 // Load Shell32.dll into memory. | 552 // Load Shell32.dll into memory. |
553 // TODO(brg): Remove this mechanism when the Win7 SDK is available in trunk. | 553 // TODO(brg): Remove this mechanism when the Win7 SDK is available in trunk. |
554 std::wstring shell32_filename(kShell32); | 554 std::wstring shell32_filename(kShell32); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
590 base::ScopedNativeLibrary user32( | 590 base::ScopedNativeLibrary user32( |
591 FilePath(base::GetNativeLibraryName(L"user32"))); | 591 FilePath(base::GetNativeLibraryName(L"user32"))); |
592 typedef BOOL (*SetProcessDPIAwareFunc)(); | 592 typedef BOOL (*SetProcessDPIAwareFunc)(); |
593 SetProcessDPIAwareFunc set_process_dpi_aware = | 593 SetProcessDPIAwareFunc set_process_dpi_aware = |
594 (SetProcessDPIAwareFunc)user32.GetFunctionPointer("SetProcessDPIAware"); | 594 (SetProcessDPIAwareFunc)user32.GetFunctionPointer("SetProcessDPIAware"); |
595 if (set_process_dpi_aware) | 595 if (set_process_dpi_aware) |
596 set_process_dpi_aware(); | 596 set_process_dpi_aware(); |
597 } | 597 } |
598 | 598 |
599 } // namespace win_util | 599 } // namespace win_util |
OLD | NEW |