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

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

Issue 8598031: views: Move widget/ directory to ui/views. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: reland for real Created 9 years, 1 month 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 | « views/widget/monitor_win.h ('k') | views/widget/native_widget.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "views/widget/monitor_win.h"
6
7 #include <shellapi.h>
8
9 #include "base/logging.h"
10 #include "ui/gfx/rect.h"
11
12 namespace views {
13
14 gfx::Rect GetMonitorBoundsForRect(const gfx::Rect& rect) {
15 RECT p_rect = rect.ToRECT();
16 HMONITOR monitor = MonitorFromRect(&p_rect, MONITOR_DEFAULTTONEAREST);
17 if (monitor) {
18 MONITORINFO mi = {0};
19 mi.cbSize = sizeof(mi);
20 GetMonitorInfo(monitor, &mi);
21 return gfx::Rect(mi.rcWork);
22 }
23 NOTREACHED();
24 return gfx::Rect();
25 }
26
27 HWND GetTopmostAutoHideTaskbarForEdge(UINT edge, HMONITOR monitor) {
28 APPBARDATA taskbar_data = { sizeof APPBARDATA, NULL, 0, edge };
29 HWND taskbar = reinterpret_cast<HWND>(SHAppBarMessage(ABM_GETAUTOHIDEBAR,
30 &taskbar_data));
31 return (::IsWindow(taskbar) && (monitor != NULL) &&
32 (MonitorFromWindow(taskbar, MONITOR_DEFAULTTONULL) == monitor) &&
33 (GetWindowLong(taskbar, GWL_EXSTYLE) & WS_EX_TOPMOST)) ?
34 taskbar : NULL;
35 }
36
37 } // namespace views
OLDNEW
« no previous file with comments | « views/widget/monitor_win.h ('k') | views/widget/native_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698