Index: ui/aura/monitor_manager.h |
diff --git a/ui/aura/monitor_manager.h b/ui/aura/monitor_manager.h |
index 2b2471eb5c37ccfd81992e801ef4a8b985335df8..77ad274ccffcfb94bce36dd056b231c035642581 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" |
@@ -33,6 +35,23 @@ class MonitorObserver { |
// any windows. |
class AURA_EXPORT MonitorManager { |
public: |
+ 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); |
+ |
+ // A utility function to create a root window for primary monitor. |
+ static RootWindow* CreateRootWindowForPrimaryMonitor(); |
+ |
MonitorManager(); |
virtual ~MonitorManager(); |
@@ -44,8 +63,8 @@ class AURA_EXPORT MonitorManager { |
// TODO(oshima): multiple monitor support. |
virtual void OnNativeMonitorResized(const gfx::Size& size) = 0; |
- // Create a root window for primary monitor. |
- virtual RootWindow* CreateRootWindowForMonitor(const Monitor* monitor) = 0; |
+ // Create a root window for given |monitor|. |
+ virtual RootWindow* CreateRootWindowForMonitor(Monitor* monitor) = 0; |
// Returns the monitor object nearest given |window|. |
virtual const Monitor* GetMonitorNearestWindow( |
@@ -56,21 +75,23 @@ 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; |
- // A utility function to create a root window for primary monitor. |
- RootWindow* CreateRootWindowForPrimaryMonitor(); |
- |
protected: |
// Calls observers' OnMonitorBoundsChanged methods. |
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); |
}; |