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

Unified Diff: ui/aura/screen_aura.cc

Issue 9689027: MonitorManager to manage multiple monitors. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: crash fix 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
Index: ui/aura/screen_aura.cc
diff --git a/ui/aura/screen_aura.cc b/ui/aura/screen_aura.cc
index 27e070e2b44b0d17e90e8018964c4355366d6d36..28ccc87a91df0141d73b7f9ae41faaaa9c661658 100644
--- a/ui/aura/screen_aura.cc
+++ b/ui/aura/screen_aura.cc
@@ -5,9 +5,10 @@
#include "ui/aura/screen_aura.h"
#include "base/logging.h"
+#include "ui/aura/env.h"
+#include "ui/aura/monitor.h"
+#include "ui/aura/monitor_manager.h"
#include "ui/aura/root_window.h"
-#include "ui/aura/window.h"
-#include "ui/gfx/native_widget_types.h"
namespace aura {
@@ -23,21 +24,26 @@ gfx::Point ScreenAura::GetCursorScreenPointImpl() {
gfx::Rect ScreenAura::GetMonitorWorkAreaNearestWindowImpl(
gfx::NativeWindow window) {
- return GetWorkAreaBounds();
+ return Env::GetInstance()->monitor_manager()->
+ GetMonitorNearestWindow(window)->GetWorkAreaBounds();
}
gfx::Rect ScreenAura::GetMonitorAreaNearestWindowImpl(
gfx::NativeWindow window) {
- return GetBounds();
+ return Env::GetInstance()->monitor_manager()->
+ GetMonitorNearestWindow(window)->bounds();
}
gfx::Rect ScreenAura::GetMonitorWorkAreaNearestPointImpl(
const gfx::Point& point) {
- return GetWorkAreaBounds();
+ return Env::GetInstance()->monitor_manager()->
+ GetMonitorNearestPoint(point)->GetWorkAreaBounds();
}
-gfx::Rect ScreenAura::GetMonitorAreaNearestPointImpl(const gfx::Point& point) {
- return GetBounds();
+gfx::Rect ScreenAura::GetMonitorAreaNearestPointImpl(
+ const gfx::Point& point) {
+ return Env::GetInstance()->monitor_manager()->
+ GetMonitorNearestPoint(point)->bounds();
}
gfx::NativeWindow ScreenAura::GetWindowAtCursorScreenPointImpl() {
@@ -45,22 +51,12 @@ gfx::NativeWindow ScreenAura::GetWindowAtCursorScreenPointImpl() {
return root_window_->GetTopWindowContainingPoint(point);
}
-gfx::Rect ScreenAura::GetBounds() {
- return gfx::Rect(root_window_->bounds().size());
-}
-
-gfx::Rect ScreenAura::GetWorkAreaBounds() {
- gfx::Rect bounds(GetBounds());
- bounds.Inset(work_area_insets_);
- return bounds;
-}
-
gfx::Size ScreenAura::GetPrimaryMonitorSizeImpl() {
- return GetMonitorWorkAreaNearestPoint(gfx::Point()).size();
+ return Env::GetInstance()->monitor_manager()->GetPrimaryMonitor()->size();
}
int ScreenAura::GetNumMonitorsImpl() {
- return 1;
+ return Env::GetInstance()->monitor_manager()->GetNumMonitors();
}
} // namespace aura
« ui/aura/monitor.h ('K') | « ui/aura/screen_aura.h ('k') | ui/aura/test/aura_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698