Index: chrome/browser/ui/window_sizer_win.cc |
diff --git a/chrome/browser/ui/window_sizer_win.cc b/chrome/browser/ui/window_sizer_win.cc |
index 9a4fa370d20eebdd504f161a251cbb377ee888ab..6c7fd282830ad4c9464049985740e722b3fa41f1 100644 |
--- a/chrome/browser/ui/window_sizer_win.cc |
+++ b/chrome/browser/ui/window_sizer_win.cc |
@@ -12,66 +12,6 @@ |
// opened windows. |
const int WindowSizer::kWindowTilePixels = 10; |
-// An implementation of WindowSizer::MonitorInfoProvider that gets the actual |
-// monitor information from Windows. |
-class DefaultMonitorInfoProvider : public WindowSizer::MonitorInfoProvider { |
- public: |
- DefaultMonitorInfoProvider() { } |
- |
- // Overridden from WindowSizer::MonitorInfoProvider: |
- virtual gfx::Rect GetPrimaryMonitorWorkArea() const { |
- return gfx::Rect(GetMonitorInfoForMonitor(MonitorFromWindow(NULL, |
- MONITOR_DEFAULTTOPRIMARY)).rcWork); |
- } |
- |
- virtual gfx::Rect GetPrimaryMonitorBounds() const { |
- return gfx::Rect(GetMonitorInfoForMonitor(MonitorFromWindow(NULL, |
- MONITOR_DEFAULTTOPRIMARY)).rcMonitor); |
- } |
- |
- virtual gfx::Rect GetMonitorWorkAreaMatching( |
- const gfx::Rect& match_rect) const { |
- RECT other_bounds_rect = match_rect.ToRECT(); |
- MONITORINFO monitor_info = GetMonitorInfoForMonitor(MonitorFromRect( |
- &other_bounds_rect, MONITOR_DEFAULTTONEAREST)); |
- return gfx::Rect(monitor_info.rcWork); |
- } |
- |
- void UpdateWorkAreas() { |
- work_areas_.clear(); |
- EnumDisplayMonitors(NULL, NULL, |
- &DefaultMonitorInfoProvider::MonitorEnumProc, |
- reinterpret_cast<LPARAM>(&work_areas_)); |
- } |
- |
- private: |
- // A callback for EnumDisplayMonitors that records the work area of the |
- // current monitor in the enumeration. |
- static BOOL CALLBACK MonitorEnumProc(HMONITOR monitor, |
- HDC monitor_dc, |
- LPRECT monitor_rect, |
- LPARAM data) { |
- reinterpret_cast<std::vector<gfx::Rect>*>(data)->push_back( |
- gfx::Rect(GetMonitorInfoForMonitor(monitor).rcWork)); |
- return TRUE; |
- } |
- |
- static MONITORINFO GetMonitorInfoForMonitor(HMONITOR monitor) { |
- MONITORINFO monitor_info = { 0 }; |
- monitor_info.cbSize = sizeof(monitor_info); |
- GetMonitorInfo(monitor, &monitor_info); |
- return monitor_info; |
- } |
- |
- DISALLOW_COPY_AND_ASSIGN(DefaultMonitorInfoProvider); |
-}; |
- |
-// static |
-WindowSizer::MonitorInfoProvider* |
-WindowSizer::CreateDefaultMonitorInfoProvider() { |
- return new DefaultMonitorInfoProvider(); |
-} |
- |
// static |
gfx::Point WindowSizer::GetDefaultPopupOrigin(const gfx::Size& size) { |
RECT area; |