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

Side by Side Diff: app/win_util.cc

Issue 3083022: Rework gfx::Font by moving platform-specific code into inner classes.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « app/text_elider_unittest.cc ('k') | chrome/browser/autocomplete/autocomplete_edit_view_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « app/text_elider_unittest.cc ('k') | chrome/browser/autocomplete/autocomplete_edit_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698