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

Unified Diff: ui/aura/test/test_screen.h

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix command line Created 8 years, 8 months 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 side-by-side diff with in-line comments
Download patch
Index: ui/aura/test/test_screen.h
diff --git a/ui/aura/test/test_screen.h b/ui/aura/test/test_screen.h
index 59fe63dba8f5056eba6dbbe18ea549dca950c9ea..7923d3d15a63f0bdb159d291db7de1b01d52d61c 100644
--- a/ui/aura/test/test_screen.h
+++ b/ui/aura/test/test_screen.h
@@ -7,39 +7,45 @@
#pragma once
#include "base/compiler_specific.h"
+#include "base/memory/scoped_ptr.h"
#include "ui/gfx/insets.h"
#include "ui/gfx/screen.h"
+namespace gfx {
+class Monitor;
+}
+
namespace aura {
class RootWindow;
+class MonitorAura;
// A minimal, testing Aura implementation of gfx::Screen.
-class TestScreen : public gfx::Screen {
+class TestScreen : public gfx::ScreenImpl {
public:
explicit TestScreen(aura::RootWindow* root_window);
virtual ~TestScreen();
protected:
- virtual gfx::Point GetCursorScreenPointImpl() OVERRIDE;
- virtual gfx::Rect GetMonitorWorkAreaNearestWindowImpl(
- gfx::NativeView view) OVERRIDE;
- virtual gfx::Rect GetMonitorAreaNearestWindowImpl(
+ // gfx::ScreenImpl overrides:
+ virtual gfx::Point GetCursorScreenPoint() OVERRIDE;
+ virtual gfx::NativeWindow GetWindowAtCursorScreenPoint() OVERRIDE;
+ virtual int GetNumMonitors() OVERRIDE;
+ virtual const gfx::Monitor* GetMonitorNearestWindow(
gfx::NativeView view) OVERRIDE;
- virtual gfx::Rect GetMonitorWorkAreaNearestPointImpl(
+ virtual const gfx::Monitor* GetMonitorNearestPoint(
const gfx::Point& point) OVERRIDE;
- virtual gfx::Rect GetMonitorAreaNearestPointImpl(
- const gfx::Point& point) OVERRIDE;
- virtual gfx::NativeWindow GetWindowAtCursorScreenPointImpl() OVERRIDE;
- virtual gfx::Size GetPrimaryMonitorSizeImpl() OVERRIDE;
- virtual int GetNumMonitorsImpl() OVERRIDE;
+ virtual const gfx::Monitor* GetPrimaryMonitor() OVERRIDE;
+ virtual void AddMonitorObserver(gfx::MonitorObserver* observer) OVERRIDE;
+ virtual void RemoveMonitorObserver(gfx::MonitorObserver* observer) OVERRIDE;
private:
- // We currently support only one monitor. These two methods return the bounds
- // and work area.
- gfx::Rect GetBounds();
+ void Update();
aura::RootWindow* root_window_;
+ // One monitor in testing environment.
+ scoped_ptr<MonitorAura> monitor_;
+
DISALLOW_COPY_AND_ASSIGN(TestScreen);
};

Powered by Google App Engine
This is Rietveld 408576698