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

Unified Diff: ui/aura/monitor_manager.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: cleanup 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/monitor_manager.h
diff --git a/ui/aura/monitor_manager.h b/ui/aura/monitor_manager.h
index 9bbd028df9173d6d1b754d4c347a68d6ad2a10bd..e7482407e9cf547c3b8c4310b3b40dd5b9af28e6 100644
--- a/ui/aura/monitor_manager.h
+++ b/ui/aura/monitor_manager.h
@@ -14,24 +14,16 @@
#include "ui/aura/aura_export.h"
namespace gfx {
+class Monitor;
class Point;
class Size;
}
namespace aura {
-class Monitor;
+class MonitorObserver;
class RootWindow;
class Window;
-// Observers for monitor configuration changes.
-// TODO(oshima): multiple monitor support.
-class MonitorObserver {
- public:
- virtual void OnMonitorBoundsChanged(const Monitor* monitor) = 0;
- virtual void OnMonitorAdded(Monitor* new_monitor) = 0;
- virtual void OnMonitorRemoved(const Monitor* old_monitor) = 0;
-};
-
// MonitorManager creates, deletes and updates Monitor objects when
// monitor configuration changes, and notifies MonitorObservers about
// the change. This is owned by Env and its lifetime is longer than
@@ -50,7 +42,7 @@ class AURA_EXPORT MonitorManager {
// The location can be omitted and be just "1440x800", which creates
// monitor at the origin of the screen. An empty string creates
// the monitor with default size.
- static Monitor* CreateMonitorFromSpec(const std::string& spec);
+ static gfx::Monitor* CreateMonitorFromSpec(const std::string& spec);
// A utility function to create a root window for primary monitor.
static RootWindow* CreateRootWindowForPrimaryMonitor();
@@ -66,31 +58,31 @@ class AURA_EXPORT MonitorManager {
// configurations is passed as a vector of Monitor object, which
// contains each monitor's new infomration.
virtual void OnNativeMonitorsChanged(
- const std::vector<const Monitor*>& monitors) = 0;
+ const std::vector<const gfx::Monitor*>& monitors) = 0;
Ben Goodger (Google) 2012/04/24 21:17:08 const std::vector<gfx::Monitor>& monitors
oshima 2012/04/25 02:38:01 Done.
// Create a root window for given |monitor|.
- virtual RootWindow* CreateRootWindowForMonitor(Monitor* monitor) = 0;
+ virtual RootWindow* CreateRootWindowForMonitor(gfx::Monitor* monitor) = 0;
Ben Goodger (Google) 2012/04/24 21:17:08 const gfx::Monitor& monitor
oshima 2012/04/25 02:38:01 Done.
+
+ // Returns the monitor at |index|. The monitor at 0 is considered
+ // "primary".
+ virtual gfx::Monitor* GetMonitorAt(size_t index) = 0;
+
+ virtual size_t GetNumMonitors() const = 0;
// Returns the monitor object nearest given |window|.
- virtual const Monitor* GetMonitorNearestWindow(
+ virtual const gfx::Monitor* GetMonitorNearestWindow(
const Window* window) const = 0;
- virtual Monitor* GetMonitorNearestWindow(const Window* window) = 0;
+ virtual gfx::Monitor* GetMonitorNearestWindow(const Window* window) = 0;
// Returns the monitor object nearest given |pint|.
- virtual const Monitor* GetMonitorNearestPoint(
+ virtual const gfx::Monitor* GetMonitorNearestPoint(
const gfx::Point& point) const = 0;
- // Returns the monitor at |index|. The monitor at 0 is considered
- // "primary".
- virtual Monitor* GetMonitorAt(size_t index) = 0;
-
- virtual size_t GetNumMonitors() const = 0;
-
protected:
// Calls observers' OnMonitorBoundsChanged methods.
- void NotifyBoundsChanged(const Monitor* monitor);
- void NotifyMonitorAdded(Monitor* monitor);
- void NotifyMonitorRemoved(const Monitor* monitor);
+ void NotifyBoundsChanged(const gfx::Monitor* monitor);
+ void NotifyMonitorAdded(gfx::Monitor* monitor);
+ void NotifyMonitorRemoved(const gfx::Monitor* monitor);
private:
// If set before the RootWindow is created, the host window will cover the

Powered by Google App Engine
This is Rietveld 408576698