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

Side by Side Diff: ui/gfx/screen_wayland.cc

Issue 7467007: Adding Wayland support for ui/gfx (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Accidentally pulled in some extra changes in common.gypi Created 9 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698