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

Side by Side Diff: chrome/common/win_util.cc

Issue 66055: Don't reserve space for an auto-hide taskbar that's not always-on-top. Windo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 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 | « chrome/common/win_util.h ('k') | chrome/views/window/window_win.cc » ('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) 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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 SetWindowPos(window, 0, window_bounds.left, window_bounds.top, 561 SetWindowPos(window, 0, window_bounds.left, window_bounds.top,
562 window_bounds.right - window_bounds.left, 562 window_bounds.right - window_bounds.left,
563 window_bounds.bottom - window_bounds.top, 563 window_bounds.bottom - window_bounds.top,
564 SWP_NOACTIVATE | SWP_NOZORDER); 564 SWP_NOACTIVATE | SWP_NOZORDER);
565 } // else case, AdjustWindowToFit set the bounds for us. 565 } // else case, AdjustWindowToFit set the bounds for us.
566 } else { 566 } else {
567 NOTREACHED() << "Unable to adjust window to fit"; 567 NOTREACHED() << "Unable to adjust window to fit";
568 } 568 }
569 } 569 }
570 570
571 bool EdgeHasAutoHideTaskbar(UINT edge, HMONITOR monitor) { 571 bool EdgeHasTopmostAutoHideTaskbar(UINT edge, HMONITOR monitor) {
572 APPBARDATA taskbar_data = { 0 }; 572 APPBARDATA taskbar_data = { 0 };
573 taskbar_data.cbSize = sizeof APPBARDATA; 573 taskbar_data.cbSize = sizeof APPBARDATA;
574 taskbar_data.uEdge = edge; 574 taskbar_data.uEdge = edge;
575 HWND taskbar = reinterpret_cast<HWND>(SHAppBarMessage(ABM_GETAUTOHIDEBAR, 575 HWND taskbar = reinterpret_cast<HWND>(SHAppBarMessage(ABM_GETAUTOHIDEBAR,
576 &taskbar_data)); 576 &taskbar_data));
577 return ::IsWindow(taskbar) && 577 return ::IsWindow(taskbar) &&
578 (MonitorFromWindow(taskbar, MONITOR_DEFAULTTONEAREST) == monitor); 578 (MonitorFromWindow(taskbar, MONITOR_DEFAULTTONULL) == monitor) &&
579 (GetWindowLong(taskbar, GWL_EXSTYLE) & WS_EX_TOPMOST);
579 } 580 }
580 581
581 HANDLE GetSectionFromProcess(HANDLE section, HANDLE process, bool read_only) { 582 HANDLE GetSectionFromProcess(HANDLE section, HANDLE process, bool read_only) {
582 HANDLE valid_section = NULL; 583 HANDLE valid_section = NULL;
583 DWORD access = STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ; 584 DWORD access = STANDARD_RIGHTS_REQUIRED | FILE_MAP_READ;
584 if (!read_only) 585 if (!read_only)
585 access |= FILE_MAP_WRITE; 586 access |= FILE_MAP_WRITE;
586 DuplicateHandle(process, section, GetCurrentProcess(), &valid_section, access, 587 DuplicateHandle(process, section, GetCurrentProcess(), &valid_section, access,
587 FALSE, 0); 588 FALSE, 0);
588 return valid_section; 589 return valid_section;
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 } 852 }
852 853
853 ChromeFont GetWindowTitleFont() { 854 ChromeFont GetWindowTitleFont() {
854 NONCLIENTMETRICS ncm; 855 NONCLIENTMETRICS ncm;
855 win_util::GetNonClientMetrics(&ncm); 856 win_util::GetNonClientMetrics(&ncm);
856 ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); 857 ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont)));
857 return ChromeFont::CreateFont(caption_font); 858 return ChromeFont::CreateFont(caption_font);
858 } 859 }
859 860
860 } // namespace win_util 861 } // namespace win_util
OLDNEW
« no previous file with comments | « chrome/common/win_util.h ('k') | chrome/views/window/window_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698