Index: ui/aura/monitor_manager.h |
diff --git a/ui/aura/monitor_manager.h b/ui/aura/monitor_manager.h |
index 2b2471eb5c37ccfd81992e801ef4a8b985335df8..9e14927dc395859ca428929bc1fe1d4b6b15600e 100644 |
--- a/ui/aura/monitor_manager.h |
+++ b/ui/aura/monitor_manager.h |
@@ -6,6 +6,8 @@ |
#define UI_AURA_MONITOR_MANAGER_H_ |
#pragma once |
+#include <string> |
+ |
#include "base/basictypes.h" |
#include "base/observer_list.h" |
#include "ui/aura/aura_export.h" |
@@ -36,6 +38,20 @@ class AURA_EXPORT MonitorManager { |
MonitorManager(); |
virtual ~MonitorManager(); |
+ static void set_use_fullscreen_host_window(bool use_fullscreen) { |
+ use_fullscreen_host_window_ = use_fullscreen; |
+ } |
+ static bool use_fullscreen_host_window() { |
+ return use_fullscreen_host_window_; |
+ } |
+ |
+ // Creates a monitor from string spec. 100+200-1440x800 creates monitor |
+ // whose size is 1440x800 at the location (100, 200) in screen's coordinates. |
+ // 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); |
+ |
// Adds/removes MonitorObservers. |
void AddObserver(MonitorObserver* observer); |
void RemoveObserver(MonitorObserver* observer); |
@@ -45,7 +61,7 @@ class AURA_EXPORT MonitorManager { |
virtual void OnNativeMonitorResized(const gfx::Size& size) = 0; |
// Create a root window for primary monitor. |
- virtual RootWindow* CreateRootWindowForMonitor(const Monitor* monitor) = 0; |
+ virtual RootWindow* CreateRootWindowForMonitor(Monitor* monitor) = 0; |
// Returns the monitor object nearest given |window|. |
virtual const Monitor* GetMonitorNearestWindow( |
@@ -56,8 +72,9 @@ class AURA_EXPORT MonitorManager { |
virtual const Monitor* GetMonitorNearestPoint( |
const gfx::Point& point) const = 0; |
- // Returns the monitor that is consiered "primary". |
- virtual const Monitor* GetPrimaryMonitor() const = 0; |
+ // Returns the monitor at |index|. The monitor at 0 is consiered |
+ // "primary". |
+ virtual Monitor* GetMonitorAt(size_t index) = 0; |
virtual size_t GetNumMonitors() const = 0; |
@@ -69,8 +86,12 @@ class AURA_EXPORT MonitorManager { |
void NotifyBoundsChanged(const Monitor* monitor); |
private: |
- ObserverList<MonitorObserver> observers_; |
+ // If set before the RootWindow is created, the host window will cover the |
+ // entire monitor. Note that this can still be overridden via the |
+ // switches::kAuraHostWindowSize flag. |
+ static bool use_fullscreen_host_window_; |
+ ObserverList<MonitorObserver> observers_; |
DISALLOW_COPY_AND_ASSIGN(MonitorManager); |
}; |