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.
4
5#ifndef MOJO_SERVICES_VIEW_MANAGER_SCREEN_IMPL_H_
6#define MOJO_SERVICES_VIEW_MANAGER_SCREEN_IMPL_H_
7
8#include "base/compiler_specific.h"
9#include "ui/gfx/display.h"
10#include "ui/gfx/screen.h"
11
12namespace gfx {
13class Rect;
14class Transform;
15}
16
17namespace mojo {
18namespace view_manager {
19namespace service {
20
21// A minimal implementation of gfx::Screen for the view manager.
22class ScreenImpl : public gfx::Screen {
23 public:
24  static gfx::Screen* Create();
25  virtual ~ScreenImpl();
26
27 protected:
28  // gfx::Screen overrides:
29  virtual bool IsDIPEnabled() OVERRIDE;
30  virtual gfx::Point GetCursorScreenPoint() OVERRIDE;
31  virtual gfx::NativeWindow GetWindowUnderCursor() OVERRIDE;
32  virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point)
33      OVERRIDE;
34  virtual int GetNumDisplays() const OVERRIDE;
35  virtual std::vector<gfx::Display> GetAllDisplays() const OVERRIDE;
36  virtual gfx::Display GetDisplayNearestWindow(
37      gfx::NativeView view) const OVERRIDE;
38  virtual gfx::Display GetDisplayNearestPoint(
39      const gfx::Point& point) const OVERRIDE;
40  virtual gfx::Display GetDisplayMatching(
41      const gfx::Rect& match_rect) const OVERRIDE;
42  virtual gfx::Display GetPrimaryDisplay() const OVERRIDE;
43  virtual void AddObserver(gfx::DisplayObserver* observer) OVERRIDE;
44  virtual void RemoveObserver(gfx::DisplayObserver* observer) OVERRIDE;
45
46 private:
47  explicit ScreenImpl(const gfx::Rect& screen_bounds);
48
49  gfx::Display display_;
50
51  DISALLOW_COPY_AND_ASSIGN(ScreenImpl);
52};
53
54}  // namespace service
55}  // namespace view_manager
56}  // namespace mojo
57
58#endif  // MOJO_SERVICES_VIEW_MANAGER_SCREEN_IMPL_H_
59