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

Unified Diff: ash/monitor/multi_monitor_manager.h

Issue 9837046: Revert r128507 "Revert r128436 "relanding: disabled workspace_window_resizer test. fixed access-aft… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | « ash/monitor/monitor_controller.cc ('k') | ash/monitor/multi_monitor_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « ash/monitor/monitor_controller.cc ('k') | ash/monitor/multi_monitor_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698