| Index: ui/aura/test/test_screen.cc
|
| diff --git a/ui/aura/test/test_screen.cc b/ui/aura/test/test_screen.cc
|
| index e61db9fdcdc5ea8eb19f88072e052de29baa6297..39c7f6a770199e86e6395e23305fba28c0952625 100644
|
| --- a/ui/aura/test/test_screen.cc
|
| +++ b/ui/aura/test/test_screen.cc
|
| @@ -5,57 +5,54 @@
|
| #include "ui/aura/test/test_screen.h"
|
|
|
| #include "base/logging.h"
|
| +#include "ui/aura/monitor_aura.h"
|
| #include "ui/aura/root_window.h"
|
| #include "ui/aura/window.h"
|
| #include "ui/gfx/native_widget_types.h"
|
| +#include "ui/gfx/monitor.h"
|
| +#include "ui/gfx/screen.h"
|
|
|
| namespace aura {
|
|
|
| TestScreen::TestScreen(aura::RootWindow* root_window)
|
| - : root_window_(root_window) {
|
| + : root_window_(root_window),
|
| + monitor_(new MonitorAura()) {
|
| }
|
|
|
| TestScreen::~TestScreen() {
|
| }
|
|
|
| -gfx::Point TestScreen::GetCursorScreenPointImpl() {
|
| +gfx::Point TestScreen::GetCursorScreenPoint() {
|
| return root_window_->last_mouse_location();
|
| }
|
|
|
| -gfx::Rect TestScreen::GetMonitorWorkAreaNearestWindowImpl(
|
| - gfx::NativeWindow window) {
|
| - return GetBounds();
|
| -}
|
| -
|
| -gfx::Rect TestScreen::GetMonitorAreaNearestWindowImpl(
|
| - gfx::NativeWindow window) {
|
| - return GetBounds();
|
| -}
|
| -
|
| -gfx::Rect TestScreen::GetMonitorWorkAreaNearestPointImpl(
|
| - const gfx::Point& point) {
|
| - return GetBounds();
|
| +gfx::NativeWindow TestScreen::GetWindowAtCursorScreenPoint() {
|
| + const gfx::Point point = gfx::Screen::GetCursorScreenPoint();
|
| + return root_window_->GetTopWindowContainingPoint(point);
|
| }
|
|
|
| -gfx::Rect TestScreen::GetMonitorAreaNearestPointImpl(const gfx::Point& point) {
|
| - return GetBounds();
|
| +int TestScreen::GetNumMonitors() {
|
| + return 1;
|
| }
|
|
|
| -gfx::NativeWindow TestScreen::GetWindowAtCursorScreenPointImpl() {
|
| - const gfx::Point point = GetCursorScreenPoint();
|
| - return root_window_->GetTopWindowContainingPoint(point);
|
| +void TestScreen::GetMonitorNearestWindow(
|
| + gfx::NativeWindow window, gfx::Monitor* monitor_out) const {
|
| + CopyTo(monitor_out);
|
| }
|
|
|
| -gfx::Rect TestScreen::GetBounds() {
|
| - return gfx::Rect(root_window_->bounds().size());
|
| +void TestScreen::GetMonitorNearestPoint(
|
| + const gfx::Point& point, gfx::Monitor* monitor_out) const {
|
| + CopyTo(monitor_out);
|
| }
|
|
|
| -gfx::Size TestScreen::GetPrimaryMonitorSizeImpl() {
|
| - return GetBounds().size();
|
| +void TestScreen::GetPrimaryMonitor(gfx::Monitor* monitor_out) const {
|
| + CopyTo(monitor_out);
|
| }
|
|
|
| -int TestScreen::GetNumMonitorsImpl() {
|
| - return 1;
|
| +void TestScreen::CopyTo(gfx::Monitor* monitor_out) const {
|
| + monitor_out->set_bounds(root_window_->bounds());
|
| + monitor_out->set_work_area(root_window_->bounds());
|
| + monitor_out->set_device_scale_factor(1.0);
|
| }
|
|
|
| } // namespace aura
|
|
|