fix: sync api::Screen wrapper method sigs to upstream (#38597)

refactor: sync api::Screen getter sigs to upstream

ui::Display GetAllDisplays(), GetPrimaryDisplay(), GetDisplayMatching(),
and GetDisplayNearestPoint() methods are all const, so make our wrappers
const too.

ui::Display GetAllDisplays() returns a const reference, so make our
wrapper return a const reference too. This avoids creating a new
std::vector<display::Display> each time it's called.
This commit is contained in:
Charles Kerr 2023-06-07 02:28:50 -05:00 committed by GitHub
parent 80246cf97f
commit 5931f69f18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 20 deletions

View file

@ -87,22 +87,6 @@ gfx::Point Screen::GetCursorScreenPoint(v8::Isolate* isolate) {
return screen_->GetCursorScreenPoint();
}
display::Display Screen::GetPrimaryDisplay() {
return screen_->GetPrimaryDisplay();
}
std::vector<display::Display> Screen::GetAllDisplays() {
return screen_->GetAllDisplays();
}
display::Display Screen::GetDisplayNearestPoint(const gfx::Point& point) {
return screen_->GetDisplayNearestPoint(point);
}
display::Display Screen::GetDisplayMatching(const gfx::Rect& match_rect) {
return screen_->GetDisplayMatching(match_rect);
}
#if BUILDFLAG(IS_WIN)
static gfx::Rect ScreenToDIPRect(electron::NativeWindow* window,