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: sync 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
« no previous file with comments | « ui/aura/monitor_change_observer_x11.cc ('k') | ui/aura/monitor_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/monitor_manager.h
diff --git a/ui/aura/monitor_manager.h b/ui/aura/monitor_manager.h
index 9bbd028df9173d6d1b754d4c347a68d6ad2a10bd..b3886cf3e5700bc29018fe6b3b5fabc057ffee3e 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<gfx::Monitor>& monitors) = 0;
// Create a root window for given |monitor|.
- virtual RootWindow* CreateRootWindowForMonitor(Monitor* monitor) = 0;
+ virtual RootWindow* CreateRootWindowForMonitor(
+ const gfx::Monitor& monitor) = 0;
+
+ // Returns the monitor at |index|. The monitor at 0 is considered
+ // "primary".
+ virtual const 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;
// 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(const gfx::Monitor& monitor);
+ void NotifyMonitorRemoved(const gfx::Monitor& monitor);
private:
// If set before the RootWindow is created, the host window will cover the
« no previous file with comments | « ui/aura/monitor_change_observer_x11.cc ('k') | ui/aura/monitor_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698