Roll WebRTC 9745:9761, Libjingle 9742:9761
[chromium-blink-merge.git] / ui / mojo / init / screen_mojo.cc
blob1ed0d4146aeffb41f823426d02e05ba8eab3a4d4
1 // Copyright 2015 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 #include "ui/mojo/init/screen_mojo.h"
7 namespace ui {
8 namespace mojo {
10 ScreenMojo::ScreenMojo(const gfx::Size& screen_size_in_pixels,
11 float device_pixel_ratio)
12 : screen_size_in_pixels_(screen_size_in_pixels),
13 device_pixel_ratio_(device_pixel_ratio) {
14 static int64 synthesized_display_id = 2000;
15 display_.set_id(synthesized_display_id++);
16 display_.SetScaleAndBounds(device_pixel_ratio,
17 gfx::Rect(screen_size_in_pixels));
20 gfx::Point ScreenMojo::GetCursorScreenPoint() {
21 return gfx::Point();
24 gfx::NativeWindow ScreenMojo::GetWindowUnderCursor() {
25 NOTIMPLEMENTED();
26 return nullptr;
29 gfx::NativeWindow ScreenMojo::GetWindowAtScreenPoint(const gfx::Point& point) {
30 NOTIMPLEMENTED();
31 return nullptr;
34 gfx::Display ScreenMojo::GetPrimaryDisplay() const {
35 return display_;
38 gfx::Display ScreenMojo::GetDisplayNearestWindow(gfx::NativeView view) const {
39 return GetPrimaryDisplay();
42 gfx::Display ScreenMojo::GetDisplayNearestPoint(const gfx::Point& point) const {
43 return GetPrimaryDisplay();
46 int ScreenMojo::GetNumDisplays() const {
47 return 1;
50 std::vector<gfx::Display> ScreenMojo::GetAllDisplays() const {
51 return std::vector<gfx::Display>(1, GetPrimaryDisplay());
54 gfx::Display ScreenMojo::GetDisplayMatching(const gfx::Rect& match_rect) const {
55 return GetPrimaryDisplay();
58 void ScreenMojo::AddObserver(gfx::DisplayObserver* observer) {
59 // TODO: add support for display changes.
62 void ScreenMojo::RemoveObserver(gfx::DisplayObserver* observer) {
63 // TODO: add support for display changes.
66 } // namespace mojo
67 } // namespace ui