Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ui/gfx/screen.h" | |
| 6 | |
| 7 #include "base/logging.h" | |
| 8 #include "ui/gfx/gl/gl_surface_egl.h" | |
| 9 #include "ui/wayland/wayland_display.h" | |
| 10 #include "ui/wayland/wayland_screen.h" | |
| 11 | |
| 12 namespace gfx { | |
| 13 | |
| 14 // static | |
| 15 gfx::Point Screen::GetCursorScreenPoint() { | |
| 16 NOTIMPLEMENTED(); | |
| 17 return gfx::Point(); | |
| 18 } | |
| 19 | |
| 20 gfx::Rect static GetPrimaryMonitorBounds() { | |
| 21 ui::WaylandDisplay* display = ui::WaylandDisplay::GetDisplay( | |
| 22 gfx::GLSurfaceEGL::GetNativeDisplay()); | |
| 23 std::list<ui::WaylandScreen*> screens = display->GetScreenList(); | |
| 24 | |
|
sky
2011/07/27 15:51:05
That's a lot of empty space. Also, how about just:
| |
| 25 if (screens.empty()) { | |
| 26 return gfx::Rect(); | |
| 27 } | |
| 28 | |
| 29 return screens.front()->GetAllocation(); | |
| 30 } | |
| 31 | |
| 32 // static | |
| 33 gfx::Rect Screen::GetMonitorWorkAreaNearestWindow(gfx::NativeView view) { | |
| 34 // TODO(beng): use |view|. | |
|
sky
2011/07/27 15:51:05
Remove beng here.
| |
| 35 return GetPrimaryMonitorBounds(); | |
| 36 } | |
| 37 | |
| 38 // static | |
| 39 gfx::Rect Screen::GetMonitorAreaNearestWindow(gfx::NativeView view) { | |
| 40 NOTIMPLEMENTED(); | |
| 41 return gfx::Rect(); | |
| 42 } | |
| 43 | |
| 44 // static | |
| 45 gfx::Rect Screen::GetMonitorWorkAreaNearestPoint(const gfx::Point& point) { | |
| 46 // TODO(jamiewalch): Restrict this to the work area of the monitor. | |
| 47 return GetMonitorAreaNearestPoint(point); | |
| 48 } | |
| 49 | |
| 50 // static | |
| 51 gfx::Rect Screen::GetMonitorAreaNearestPoint(const gfx::Point& point) { | |
| 52 NOTIMPLEMENTED(); | |
| 53 return gfx::Rect(); | |
| 54 } | |
| 55 | |
| 56 gfx::NativeWindow Screen::GetWindowAtCursorScreenPoint() { | |
| 57 NOTIMPLEMENTED(); | |
| 58 return NULL; | |
| 59 } | |
| 60 | |
| 61 } // namespace gfx | |
| 62 | |
| OLD | NEW |