Battery Status API: add UMA logging for Linux.
[chromium-blink-merge.git] / mojo / services / view_manager / screen_impl.cc
blob39bd91e97dcf2acae0c0774460add70c4f24c073
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.
5 #include "mojo/services/view_manager/screen_impl.h"
7 #include "ui/gfx/native_widget_types.h"
8 #include "ui/gfx/rect_conversions.h"
10 namespace mojo {
11 namespace service {
13 // static
14 gfx::Screen* ScreenImpl::Create() {
15 return new ScreenImpl(gfx::Rect(0, 0, 800, 600));
18 ScreenImpl::~ScreenImpl() {
21 bool ScreenImpl::IsDIPEnabled() {
22 NOTIMPLEMENTED();
23 return true;
26 gfx::Point ScreenImpl::GetCursorScreenPoint() {
27 NOTIMPLEMENTED();
28 return gfx::Point();
31 gfx::NativeWindow ScreenImpl::GetWindowUnderCursor() {
32 return GetWindowAtScreenPoint(GetCursorScreenPoint());
35 gfx::NativeWindow ScreenImpl::GetWindowAtScreenPoint(const gfx::Point& point) {
36 NOTIMPLEMENTED();
37 return NULL;
40 int ScreenImpl::GetNumDisplays() const {
41 return 1;
44 std::vector<gfx::Display> ScreenImpl::GetAllDisplays() const {
45 return std::vector<gfx::Display>(1, display_);
48 gfx::Display ScreenImpl::GetDisplayNearestWindow(
49 gfx::NativeWindow window) const {
50 return display_;
53 gfx::Display ScreenImpl::GetDisplayNearestPoint(const gfx::Point& point) const {
54 return display_;
57 gfx::Display ScreenImpl::GetDisplayMatching(const gfx::Rect& match_rect) const {
58 return display_;
61 gfx::Display ScreenImpl::GetPrimaryDisplay() const {
62 return display_;
65 void ScreenImpl::AddObserver(gfx::DisplayObserver* observer) {
68 void ScreenImpl::RemoveObserver(gfx::DisplayObserver* observer) {
71 ScreenImpl::ScreenImpl(const gfx::Rect& screen_bounds) {
72 static int64 synthesized_display_id = 2000;
73 display_.set_id(synthesized_display_id++);
74 display_.SetScaleAndBounds(1.0f, screen_bounds);
77 } // namespace service
78 } // namespace mojo