| Index: ash/monitor/multi_monitor_manager.h
|
| diff --git a/ash/monitor/multi_monitor_manager.h b/ash/monitor/multi_monitor_manager.h
|
| index 609f931b3738343664663ea0bec03e66cd35e77d..b24c98eb86819510c2c5f6e753d406ea46f0a013 100644
|
| --- a/ash/monitor/multi_monitor_manager.h
|
| +++ b/ash/monitor/multi_monitor_manager.h
|
| @@ -6,23 +6,38 @@
|
| #define ASH_MONITOR_MULTI_MONITOR_MANAGER_H_
|
| #pragma once
|
|
|
| +#include "ash/ash_export.h"
|
| #include "base/compiler_specific.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "ui/aura/monitor_manager.h"
|
| +#include "ui/aura/root_window_observer.h"
|
| #include "ui/aura/window.h"
|
| #include "ui/aura/window_observer.h"
|
|
|
| namespace ash {
|
| namespace internal {
|
|
|
| -class MultiMonitorManager : public aura::MonitorManager,
|
| - public aura::WindowObserver {
|
| +// MultiMonitorManager maintains the current monitor configurations,
|
| +// and notifies observers when configuration changes.
|
| +// This is exported for unittest.
|
| +//
|
| +// TODO(oshima): gfx::Screen needs to return translated coordinates
|
| +// if the root window is translated. crbug.com/119268.
|
| +class ASH_EXPORT MultiMonitorManager : public aura::MonitorManager,
|
| + public aura::RootWindowObserver,
|
| + public aura::WindowObserver {
|
| public:
|
| MultiMonitorManager();
|
| virtual ~MultiMonitorManager();
|
|
|
| + // Used to emulate monitor change when run in a desktop environment instead
|
| + // of on a device.
|
| + static void AddRemoveMonitor();
|
| + static void CycleMonitor();
|
| +
|
| // MonitorManager overrides:
|
| - virtual void OnNativeMonitorResized(const gfx::Size& size) OVERRIDE;
|
| + virtual void OnNativeMonitorsChanged(
|
| + const std::vector<const aura::Monitor*>& monitors) OVERRIDE;
|
| virtual aura::RootWindow* CreateRootWindowForMonitor(
|
| aura::Monitor* monitor) OVERRIDE;
|
| virtual const aura::Monitor* GetMonitorNearestWindow(
|
| @@ -34,15 +49,19 @@ class MultiMonitorManager : public aura::MonitorManager,
|
| virtual aura::Monitor* GetMonitorNearestWindow(
|
| const aura::Window* window) OVERRIDE;
|
|
|
| + // RootWindowObserver overrides:
|
| + virtual void OnRootWindowResized(const aura::RootWindow* root,
|
| + const gfx::Size& new_size) OVERRIDE;
|
| +
|
| // WindowObserver overrides:
|
| - virtual void OnWindowBoundsChanged(aura::Window* window,
|
| - const gfx::Rect& bounds) OVERRIDE;
|
| virtual void OnWindowDestroying(aura::Window* window) OVERRIDE;
|
|
|
| private:
|
| typedef std::vector<aura::Monitor*> Monitors;
|
|
|
| void Init();
|
| + void AddRemoveMonitorImpl();
|
| + void CycleMonitorImpl();
|
|
|
| Monitors monitors_;
|
|
|
|
|