blob: 95adee3745e9a3d9337118ecc33aef289ebb8890 (
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
// Copyright 2021 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.
#include "extensions/browser/mock_screen.h"
namespace extensions {
MockScreen::MockScreen() {
for (int i = 0; i < 4; i++) {
gfx::Rect bounds(0, 0, 1280, 720);
gfx::Rect work_area(0, 0, 960, 720);
display::Display display(i, bounds);
display.set_work_area(work_area);
displays_.push_back(display);
}
}
MockScreen::~MockScreen() = default;
gfx::Point MockScreen::GetCursorScreenPoint() {
return gfx::Point();
}
bool MockScreen::IsWindowUnderCursor(gfx::NativeWindow window) {
return false;
}
gfx::NativeWindow MockScreen::GetWindowAtScreenPoint(const gfx::Point& point) {
return nullptr;
}
gfx::NativeWindow MockScreen::GetLocalProcessWindowAtPoint(
const gfx::Point& point,
const std::set<gfx::NativeWindow>& ignore) {
return nullptr;
}
int MockScreen::GetNumDisplays() const {
return static_cast<int>(displays_.size());
}
const std::vector<display::Display>& MockScreen::GetAllDisplays() const {
return displays_;
}
display::Display MockScreen::GetDisplayNearestWindow(
gfx::NativeWindow window) const {
return display::Display(0);
}
display::Display MockScreen::GetDisplayNearestPoint(
const gfx::Point& point) const {
return display::Display(0);
}
display::Display MockScreen::GetDisplayMatching(
const gfx::Rect& match_rect) const {
return display::Display(0);
}
display::Display MockScreen::GetPrimaryDisplay() const {
return displays_[0];
}
} // namespace extensions
|