OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/gfx/screen.h" |
| 6 |
| 7 #include "ui/gfx/monitor.h" |
| 8 |
| 9 namespace gfx { |
| 10 |
| 11 // Utility functions to get Monitor bounds/WorkArea bounds. |
| 12 // static |
| 13 gfx::Rect Screen::GetMonitorAreaNearestWindow(gfx::NativeView view) { |
| 14 Monitor monitor; |
| 15 GetMonitorNearestWindow(view, &monitor); |
| 16 return monitor.bounds(); |
| 17 } |
| 18 |
| 19 gfx::Rect Screen::GetMonitorWorkAreaNearestWindow(gfx::NativeView view) { |
| 20 Monitor monitor; |
| 21 GetMonitorNearestWindow(view, &monitor); |
| 22 return monitor.work_area(); |
| 23 } |
| 24 |
| 25 gfx::Rect Screen::GetMonitorAreaNearestPoint(const gfx::Point& point) { |
| 26 Monitor monitor; |
| 27 GetMonitorNearestPoint(point, &monitor); |
| 28 return monitor.bounds(); |
| 29 } |
| 30 |
| 31 gfx::Rect Screen::GetMonitorWorkAreaNearestPoint(const gfx::Point& point) { |
| 32 Monitor monitor; |
| 33 GetMonitorNearestPoint(point, &monitor); |
| 34 return monitor.work_area(); |
| 35 } |
| 36 |
| 37 gfx::Rect Screen::GetPrimaryMonitorBounds() { |
| 38 Monitor monitor; |
| 39 GetPrimaryMonitor(&monitor); |
| 40 return monitor.bounds(); |
| 41 } |
| 42 |
| 43 gfx::Rect Screen::GetPrimaryMonitorWorkArea() { |
| 44 Monitor monitor; |
| 45 GetPrimaryMonitor(&monitor); |
| 46 return monitor.work_area(); |
| 47 } |
| 48 |
| 49 } // namespace gfx |
OLD | NEW |