| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 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 | 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/aura/screen_aura.h" | 5 #include "ui/aura/screen_aura.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/aura/desktop.h" | 8 #include "ui/aura/root_window.h" |
| 9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| 11 | 11 |
| 12 namespace aura { | 12 namespace aura { |
| 13 | 13 |
| 14 ScreenAura::ScreenAura() { | 14 ScreenAura::ScreenAura() { |
| 15 } | 15 } |
| 16 | 16 |
| 17 ScreenAura::~ScreenAura() { | 17 ScreenAura::~ScreenAura() { |
| 18 } | 18 } |
| 19 | 19 |
| 20 gfx::Point ScreenAura::GetCursorScreenPointImpl() { | 20 gfx::Point ScreenAura::GetCursorScreenPointImpl() { |
| 21 return Desktop::GetInstance()->last_mouse_location(); | 21 return RootWindow::GetInstance()->last_mouse_location(); |
| 22 } | 22 } |
| 23 | 23 |
| 24 gfx::Rect ScreenAura::GetMonitorWorkAreaNearestWindowImpl( | 24 gfx::Rect ScreenAura::GetMonitorWorkAreaNearestWindowImpl( |
| 25 gfx::NativeWindow window) { | 25 gfx::NativeWindow window) { |
| 26 return GetWorkAreaBounds(); | 26 return GetWorkAreaBounds(); |
| 27 } | 27 } |
| 28 | 28 |
| 29 gfx::Rect ScreenAura::GetMonitorAreaNearestWindowImpl( | 29 gfx::Rect ScreenAura::GetMonitorAreaNearestWindowImpl( |
| 30 gfx::NativeWindow window) { | 30 gfx::NativeWindow window) { |
| 31 return GetBounds(); | 31 return GetBounds(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 gfx::Rect ScreenAura::GetMonitorWorkAreaNearestPointImpl( | 34 gfx::Rect ScreenAura::GetMonitorWorkAreaNearestPointImpl( |
| 35 const gfx::Point& point) { | 35 const gfx::Point& point) { |
| 36 return GetWorkAreaBounds(); | 36 return GetWorkAreaBounds(); |
| 37 } | 37 } |
| 38 | 38 |
| 39 gfx::Rect ScreenAura::GetMonitorAreaNearestPointImpl(const gfx::Point& point) { | 39 gfx::Rect ScreenAura::GetMonitorAreaNearestPointImpl(const gfx::Point& point) { |
| 40 return GetBounds(); | 40 return GetBounds(); |
| 41 } | 41 } |
| 42 | 42 |
| 43 gfx::NativeWindow ScreenAura::GetWindowAtCursorScreenPointImpl() { | 43 gfx::NativeWindow ScreenAura::GetWindowAtCursorScreenPointImpl() { |
| 44 const gfx::Point point = GetCursorScreenPoint(); | 44 const gfx::Point point = GetCursorScreenPoint(); |
| 45 return Desktop::GetInstance()->GetTopWindowContainingPoint(point); | 45 return RootWindow::GetInstance()->GetTopWindowContainingPoint(point); |
| 46 } | 46 } |
| 47 | 47 |
| 48 gfx::Rect ScreenAura::GetBounds() { | 48 gfx::Rect ScreenAura::GetBounds() { |
| 49 return gfx::Rect(aura::Desktop::GetInstance()->GetHostSize()); | 49 return gfx::Rect(aura::RootWindow::GetInstance()->GetHostSize()); |
| 50 } | 50 } |
| 51 | 51 |
| 52 gfx::Rect ScreenAura::GetWorkAreaBounds() { | 52 gfx::Rect ScreenAura::GetWorkAreaBounds() { |
| 53 gfx::Rect bounds(GetBounds()); | 53 gfx::Rect bounds(GetBounds()); |
| 54 bounds.Inset(work_area_insets_); | 54 bounds.Inset(work_area_insets_); |
| 55 return bounds; | 55 return bounds; |
| 56 } | 56 } |
| 57 | 57 |
| 58 gfx::Size ScreenAura::GetPrimaryMonitorSizeImpl() { | 58 gfx::Size ScreenAura::GetPrimaryMonitorSizeImpl() { |
| 59 return GetMonitorWorkAreaNearestPoint(gfx::Point()).size(); | 59 return GetMonitorWorkAreaNearestPoint(gfx::Point()).size(); |
| 60 } | 60 } |
| 61 | 61 |
| 62 int ScreenAura::GetNumMonitorsImpl() { | 62 int ScreenAura::GetNumMonitorsImpl() { |
| 63 return 1; | 63 return 1; |
| 64 } | 64 } |
| 65 | 65 |
| 66 } // namespace aura | 66 } // namespace aura |
| OLD | NEW |