1 // Copyright 2014 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.
5 #ifndef MOJO_SERVICES_VIEW_MANAGER_SCREEN_IMPL_H_
6 #define MOJO_SERVICES_VIEW_MANAGER_SCREEN_IMPL_H_
8 #include "base/compiler_specific.h"
9 #include "ui/gfx/display.h"
10 #include "ui/gfx/screen.h"
20 // A minimal implementation of gfx::Screen for the view manager.
21 class ScreenImpl
: public gfx::Screen
{
23 static gfx::Screen
* Create();
24 virtual ~ScreenImpl();
27 // gfx::Screen overrides:
28 virtual bool IsDIPEnabled() OVERRIDE
;
29 virtual gfx::Point
GetCursorScreenPoint() OVERRIDE
;
30 virtual gfx::NativeWindow
GetWindowUnderCursor() OVERRIDE
;
31 virtual gfx::NativeWindow
GetWindowAtScreenPoint(const gfx::Point
& point
)
33 virtual int GetNumDisplays() const OVERRIDE
;
34 virtual std::vector
<gfx::Display
> GetAllDisplays() const OVERRIDE
;
35 virtual gfx::Display
GetDisplayNearestWindow(
36 gfx::NativeView view
) const OVERRIDE
;
37 virtual gfx::Display
GetDisplayNearestPoint(
38 const gfx::Point
& point
) const OVERRIDE
;
39 virtual gfx::Display
GetDisplayMatching(
40 const gfx::Rect
& match_rect
) const OVERRIDE
;
41 virtual gfx::Display
GetPrimaryDisplay() const OVERRIDE
;
42 virtual void AddObserver(gfx::DisplayObserver
* observer
) OVERRIDE
;
43 virtual void RemoveObserver(gfx::DisplayObserver
* observer
) OVERRIDE
;
46 explicit ScreenImpl(const gfx::Rect
& screen_bounds
);
48 gfx::Display display_
;
50 DISALLOW_COPY_AND_ASSIGN(ScreenImpl
);
53 } // namespace service
56 #endif // MOJO_SERVICES_VIEW_MANAGER_SCREEN_IMPL_H_