summaryrefslogtreecommitdiffstats
path: root/ui/aura/screen_aura.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/aura/screen_aura.cc')
-rw-r--r--ui/aura/screen_aura.cc34
1 files changed, 14 insertions, 20 deletions
diff --git a/ui/aura/screen_aura.cc b/ui/aura/screen_aura.cc
index 58d1c5a..16d1367 100644
--- a/ui/aura/screen_aura.cc
+++ b/ui/aura/screen_aura.cc
@@ -9,18 +9,7 @@
#include "ui/aura/window.h"
#include "ui/gfx/native_widget_types.h"
-namespace {
-
-gfx::Rect GetMonitorAreaOrWorkAreaNearestPoint(const gfx::Point& point,
- bool work_area) {
- // TODO(oshima): Take point/work_area into account. Support multiple monitors.
- return gfx::Rect(aura::Desktop::GetInstance()->GetHostSize());
-}
-
-} // namespace
-
namespace aura {
-namespace internal {
ScreenAura::ScreenAura() {
}
@@ -34,25 +23,21 @@ gfx::Point ScreenAura::GetCursorScreenPointImpl() {
gfx::Rect ScreenAura::GetMonitorWorkAreaNearestWindowImpl(
gfx::NativeWindow window) {
- gfx::Rect bounds = GetMonitorAreaNearestWindow(window);
- // Emulate that a work area can be smaller than its monitor.
- bounds.Inset(10, 10, 10, 10);
- return bounds;
+ return GetWorkAreaBounds();
}
gfx::Rect ScreenAura::GetMonitorAreaNearestWindowImpl(
gfx::NativeWindow window) {
- // TODO(oshima): Take point/work_area into account. Support multiple monitors.
- return gfx::Rect(aura::Desktop::GetInstance()->GetHostSize());
+ return GetBounds();
}
gfx::Rect ScreenAura::GetMonitorWorkAreaNearestPointImpl(
const gfx::Point& point) {
- return GetMonitorAreaOrWorkAreaNearestPoint(point, true);
+ return GetWorkAreaBounds();
}
gfx::Rect ScreenAura::GetMonitorAreaNearestPointImpl(const gfx::Point& point) {
- return GetMonitorAreaOrWorkAreaNearestPoint(point, false);
+ return GetBounds();
}
gfx::NativeWindow ScreenAura::GetWindowAtCursorScreenPointImpl() {
@@ -60,5 +45,14 @@ gfx::NativeWindow ScreenAura::GetWindowAtCursorScreenPointImpl() {
return Desktop::GetInstance()->GetTopWindowContainingPoint(point);
}
-} // namespace internal
+gfx::Rect ScreenAura::GetBounds() {
+ return gfx::Rect(aura::Desktop::GetInstance()->GetHostSize());
+}
+
+gfx::Rect ScreenAura::GetWorkAreaBounds() {
+ gfx::Rect bounds(GetBounds());
+ bounds.Inset(work_area_insets_);
+ return bounds;
+}
+
} // namespace aura