OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome/common/win_util.h" | 5 #include "chrome/common/win_util.h" |
6 | 6 |
7 #include <atlbase.h> | 7 #include <atlbase.h> |
8 #include <atlapp.h> | 8 #include <atlapp.h> |
9 #include <commdlg.h> | 9 #include <commdlg.h> |
10 #include <dwmapi.h> | 10 #include <dwmapi.h> |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
523 NOTREACHED() << "Unable to adjust window to fit"; | 523 NOTREACHED() << "Unable to adjust window to fit"; |
524 } | 524 } |
525 } | 525 } |
526 | 526 |
527 bool EdgeHasTopmostAutoHideTaskbar(UINT edge, HMONITOR monitor) { | 527 bool EdgeHasTopmostAutoHideTaskbar(UINT edge, HMONITOR monitor) { |
528 APPBARDATA taskbar_data = { 0 }; | 528 APPBARDATA taskbar_data = { 0 }; |
529 taskbar_data.cbSize = sizeof APPBARDATA; | 529 taskbar_data.cbSize = sizeof APPBARDATA; |
530 taskbar_data.uEdge = edge; | 530 taskbar_data.uEdge = edge; |
531 HWND taskbar = reinterpret_cast<HWND>(SHAppBarMessage(ABM_GETAUTOHIDEBAR, | 531 HWND taskbar = reinterpret_cast<HWND>(SHAppBarMessage(ABM_GETAUTOHIDEBAR, |
532 &taskbar_data)); | 532 &taskbar_data)); |
533 return ::IsWindow(taskbar) && | 533 return ::IsWindow(taskbar) && (monitor != NULL) && |
534 (MonitorFromWindow(taskbar, MONITOR_DEFAULTTONULL) == monitor) && | 534 (MonitorFromWindow(taskbar, MONITOR_DEFAULTTONULL) == monitor) && |
535 (GetWindowLong(taskbar, GWL_EXSTYLE) & WS_EX_TOPMOST); | 535 (GetWindowLong(taskbar, GWL_EXSTYLE) & WS_EX_TOPMOST); |
536 } | 536 } |
537 | 537 |
538 HANDLE GetSectionFromProcess(HANDLE section, HANDLE process, bool read_only) { | 538 HANDLE GetSectionFromProcess(HANDLE section, HANDLE process, bool read_only) { |
539 HANDLE valid_section = NULL; | 539 HANDLE valid_section = NULL; |
540 DWORD access = STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ; | 540 DWORD access = STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ; |
541 if (!read_only) | 541 if (!read_only) |
542 access |= FILE_MAP_WRITE; | 542 access |= FILE_MAP_WRITE; |
543 DuplicateHandle(process, section, GetCurrentProcess(), &valid_section, access, | 543 DuplicateHandle(process, section, GetCurrentProcess(), &valid_section, access, |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
808 } | 808 } |
809 | 809 |
810 ChromeFont GetWindowTitleFont() { | 810 ChromeFont GetWindowTitleFont() { |
811 NONCLIENTMETRICS ncm; | 811 NONCLIENTMETRICS ncm; |
812 win_util::GetNonClientMetrics(&ncm); | 812 win_util::GetNonClientMetrics(&ncm); |
813 ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 813 ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
814 return ChromeFont::CreateFont(caption_font); | 814 return ChromeFont::CreateFont(caption_font); |
815 } | 815 } |
816 | 816 |
817 } // namespace win_util | 817 } // namespace win_util |
OLD | NEW |