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

Side by Side Diff: ui/views/widget/monitor_win.cc

Issue 137353002: Remove GetMonitorInfoWrapper, which is no longer needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: merge Created 6 years, 10 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 | « ui/gfx/win/hwnd_util.cc ('k') | ui/views/win/fullscreen_handler.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/widget/monitor_win.h" 5 #include "ui/views/widget/monitor_win.h"
6 6
7 #include <shellapi.h> 7 #include <shellapi.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/win/win_util.h" 10 #include "base/win/win_util.h"
11 #include "ui/gfx/rect.h" 11 #include "ui/gfx/rect.h"
12 12
13 namespace views { 13 namespace views {
14 14
15 gfx::Rect GetMonitorBoundsForRect(const gfx::Rect& rect) { 15 gfx::Rect GetMonitorBoundsForRect(const gfx::Rect& rect) {
16 RECT p_rect = rect.ToRECT(); 16 RECT p_rect = rect.ToRECT();
17 HMONITOR monitor = MonitorFromRect(&p_rect, MONITOR_DEFAULTTONEAREST); 17 HMONITOR monitor = MonitorFromRect(&p_rect, MONITOR_DEFAULTTONEAREST);
18 if (monitor) { 18 if (monitor) {
19 MONITORINFO mi = {0}; 19 MONITORINFO mi = {0};
20 mi.cbSize = sizeof(mi); 20 mi.cbSize = sizeof(mi);
21 base::win::GetMonitorInfoWrapper(monitor, &mi); 21 GetMonitorInfo(monitor, &mi);
22 return gfx::Rect(mi.rcWork); 22 return gfx::Rect(mi.rcWork);
23 } 23 }
24 NOTREACHED(); 24 NOTREACHED();
25 return gfx::Rect(); 25 return gfx::Rect();
26 } 26 }
27 27
28 HWND GetTopmostAutoHideTaskbarForEdge(UINT edge, HMONITOR monitor) { 28 HWND GetTopmostAutoHideTaskbarForEdge(UINT edge, HMONITOR monitor) {
29 // NOTE: this may be invoked on a background thread. 29 // NOTE: this may be invoked on a background thread.
30 APPBARDATA taskbar_data = { sizeof(APPBARDATA), NULL, 0, edge }; 30 APPBARDATA taskbar_data = { sizeof(APPBARDATA), NULL, 0, edge };
31 HWND taskbar = reinterpret_cast<HWND>(SHAppBarMessage(ABM_GETAUTOHIDEBAR, 31 HWND taskbar = reinterpret_cast<HWND>(SHAppBarMessage(ABM_GETAUTOHIDEBAR,
32 &taskbar_data)); 32 &taskbar_data));
33 return (::IsWindow(taskbar) && (monitor != NULL) && 33 return (::IsWindow(taskbar) && (monitor != NULL) &&
34 (MonitorFromWindow(taskbar, MONITOR_DEFAULTTONULL) == monitor) && 34 (MonitorFromWindow(taskbar, MONITOR_DEFAULTTONULL) == monitor) &&
35 (GetWindowLong(taskbar, GWL_EXSTYLE) & WS_EX_TOPMOST)) ? 35 (GetWindowLong(taskbar, GWL_EXSTYLE) & WS_EX_TOPMOST)) ?
36 taskbar : NULL; 36 taskbar : NULL;
37 } 37 }
38 38
39 } // namespace views 39 } // namespace views
OLDNEW
« no previous file with comments | « ui/gfx/win/hwnd_util.cc ('k') | ui/views/win/fullscreen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698