| Index: ui/gfx/screen_win.cc
|
| diff --git a/ui/gfx/screen_win.cc b/ui/gfx/screen_win.cc
|
| index 9ea1a4c833c73fb9e41fce4a6c2bdaf7d450aaf8..642db8571bb6b7803bf801e3a902a35e1931b71c 100644
|
| --- a/ui/gfx/screen_win.cc
|
| +++ b/ui/gfx/screen_win.cc
|
| @@ -33,6 +33,20 @@ gfx::Display GetDisplay(MONITORINFOEX& monitor_info) {
|
| return display;
|
| }
|
|
|
| +BOOL CALLBACK EnumMonitorCallback(HMONITOR monitor,
|
| + HDC hdc,
|
| + LPRECT rect,
|
| + LPARAM data) {
|
| + std::vector<gfx::Display>* all_displays =
|
| + reinterpret_cast<std::vector<gfx::Display>*>(data);
|
| + DCHECK(all_displays);
|
| +
|
| + MONITORINFOEX monitor_info = GetMonitorInfoForMonitor(monitor);
|
| + gfx::Display display = GetDisplay(monitor_info);
|
| + all_displays->push_back(display);
|
| + return TRUE;
|
| +}
|
| +
|
| } // namespace
|
|
|
| namespace gfx {
|
| @@ -68,8 +82,10 @@ int ScreenWin::GetNumDisplays() const {
|
| }
|
|
|
| std::vector<gfx::Display> ScreenWin::GetAllDisplays() const {
|
| - NOTIMPLEMENTED();
|
| - return std::vector<gfx::Display>(1, GetPrimaryDisplay());
|
| + std::vector<gfx::Display> all_displays;
|
| + EnumDisplayMonitors(NULL, NULL, EnumMonitorCallback,
|
| + reinterpret_cast<LPARAM>(&all_displays));
|
| + return all_displays;
|
| }
|
|
|
| gfx::Display ScreenWin::GetDisplayNearestWindow(gfx::NativeView window) const {
|
|
|