summaryrefslogtreecommitdiffstats
path: root/ui/aura/test/test_screen.h
blob: 399b486fb0ff6a017e595f16fa0fb3d9b0236536 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_AURA_TEST_TEST_SCREEN_H_
#define UI_AURA_TEST_TEST_SCREEN_H_
#pragma once

#include "base/compiler_specific.h"
#include "ui/gfx/screen_impl.h"

namespace aura {
class RootWindow;

// A minimal, testing Aura implementation of gfx::Screen.
class TestScreen : public gfx::ScreenImpl {
 public:
  explicit TestScreen(aura::RootWindow* root_window);
  virtual ~TestScreen();

 protected:
  // gfx::ScreenImpl overrides:
  virtual gfx::Point GetCursorScreenPoint() OVERRIDE;
  virtual gfx::NativeWindow GetWindowAtCursorScreenPoint() OVERRIDE;
  virtual int GetNumDisplays() OVERRIDE;
  virtual gfx::Display GetDisplayNearestWindow(
      gfx::NativeView view) const OVERRIDE;
  virtual gfx::Display GetDisplayNearestPoint(
      const gfx::Point& point) const OVERRIDE;
  virtual gfx::Display GetPrimaryDisplay() const OVERRIDE;

 private:
  gfx::Display GetMonitor() const;

  aura::RootWindow* root_window_;

  DISALLOW_COPY_AND_ASSIGN(TestScreen);
};

}  // namespace aura

#endif  // UI_AURA_TEST_TEST_SCREEN_H_