Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / mojo / services / view_manager / screen_impl.cc
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.
4
5 #include "mojo/services/view_manager/screen_impl.h"
6
7 #include "ui/gfx/native_widget_types.h"
8 #include "ui/gfx/rect_conversions.h"
9
10 namespace mojo {
11 namespace service {
12
13 // static
14 gfx::Screen* ScreenImpl::Create() {
15   return new ScreenImpl(gfx::Rect(0, 0, 800, 600));
16 }
17
18 ScreenImpl::~ScreenImpl() {
19 }
20
21 bool ScreenImpl::IsDIPEnabled() {
22   NOTIMPLEMENTED();
23   return true;
24 }
25
26 gfx::Point ScreenImpl::GetCursorScreenPoint() {
27   NOTIMPLEMENTED();
28   return gfx::Point();
29 }
30
31 gfx::NativeWindow ScreenImpl::GetWindowUnderCursor() {
32   return GetWindowAtScreenPoint(GetCursorScreenPoint());
33 }
34
35 gfx::NativeWindow ScreenImpl::GetWindowAtScreenPoint(const gfx::Point& point) {
36   NOTIMPLEMENTED();
37   return NULL;
38 }
39
40 int ScreenImpl::GetNumDisplays() const {
41   return 1;
42 }
43
44 std::vector<gfx::Display> ScreenImpl::GetAllDisplays() const {
45   return std::vector<gfx::Display>(1, display_);
46 }
47
48 gfx::Display ScreenImpl::GetDisplayNearestWindow(
49     gfx::NativeWindow window) const {
50   return display_;
51 }
52
53 gfx::Display ScreenImpl::GetDisplayNearestPoint(const gfx::Point& point) const {
54   return display_;
55 }
56
57 gfx::Display ScreenImpl::GetDisplayMatching(const gfx::Rect& match_rect) const {
58   return display_;
59 }
60
61 gfx::Display ScreenImpl::GetPrimaryDisplay() const {
62   return display_;
63 }
64
65 void ScreenImpl::AddObserver(gfx::DisplayObserver* observer) {
66 }
67
68 void ScreenImpl::RemoveObserver(gfx::DisplayObserver* observer) {
69 }
70
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);
75 }
76
77 }  // namespace service
78 }  // namespace mojo