Index: chrome/browser/ui/monitor_info_provider_aura.cc |
diff --git a/chrome/browser/ui/monitor_info_provider_aura.cc b/chrome/browser/ui/monitor_info_provider_aura.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..1d57d07336489ce1008150f3c912d9df3d31b80b |
--- /dev/null |
+++ b/chrome/browser/ui/monitor_info_provider_aura.cc |
@@ -0,0 +1,58 @@ |
+// Copyright (c) 2011 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "chrome/browser/ui/monitor_info_provider.h" |
+ |
+#include "base/compiler_specific.h" |
+#include "ui/gfx/screen.h" |
+ |
+namespace { |
+ |
+// This assumes a single monitor, which is currently the case. |
+class MonitorInfoProviderAura : public MonitorInfoProvider { |
+ public: |
+ MonitorInfoProviderAura(); |
+ virtual ~MonitorInfoProviderAura(); |
+ |
+ // Overridden from MonitorInfoProvider: |
+ virtual gfx::Rect GetPrimaryMonitorWorkArea() const OVERRIDE; |
+ virtual gfx::Rect GetPrimaryMonitorBounds() const OVERRIDE; |
+ virtual gfx::Rect GetMonitorWorkAreaMatching( |
+ const gfx::Rect& match_rect) const OVERRIDE; |
+ virtual void UpdateWorkAreas() OVERRIDE; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(MonitorInfoProviderAura); |
+}; |
+ |
+MonitorInfoProviderAura::MonitorInfoProviderAura() { |
+} |
+ |
+MonitorInfoProviderAura::~MonitorInfoProviderAura() { |
+} |
+ |
+gfx::Rect MonitorInfoProviderAura::GetPrimaryMonitorWorkArea() const { |
+ return gfx::Screen::GetMonitorWorkAreaNearestPoint(gfx::Point()); |
+} |
+ |
+gfx::Rect MonitorInfoProviderAura::GetPrimaryMonitorBounds() const { |
+ return gfx::Screen::GetMonitorAreaNearestPoint(gfx::Point()); |
+} |
+ |
+gfx::Rect MonitorInfoProviderAura::GetMonitorWorkAreaMatching( |
+ const gfx::Rect& match_rect) const { |
+ return gfx::Screen::GetMonitorWorkAreaNearestPoint(gfx::Point()); |
+} |
+ |
+void MonitorInfoProviderAura::UpdateWorkAreas() { |
+ work_areas_.clear(); |
+ work_areas_.push_back(GetPrimaryMonitorBounds()); |
+} |
+ |
+} // namespace |
+ |
+// static |
+MonitorInfoProvider* MonitorInfoProvider::Create() { |
+ return new MonitorInfoProviderAura(); |
+} |