1 // Copyright (c) 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/aura/screen_mojo.h" 6 7 #include "ui/gfx/native_widget_types.h" 8 #include "ui/gfx/rect_conversions.h" 9 10 namespace mojo { 11 12 // static Create()13ScreenMojo* ScreenMojo::Create() { 14 return new ScreenMojo(gfx::Rect(0, 0, 800, 600)); 15 } 16 ~ScreenMojo()17ScreenMojo::~ScreenMojo() { 18 } 19 IsDIPEnabled()20bool ScreenMojo::IsDIPEnabled() { 21 NOTIMPLEMENTED(); 22 return true; 23 } 24 GetCursorScreenPoint()25gfx::Point ScreenMojo::GetCursorScreenPoint() { 26 NOTIMPLEMENTED(); 27 return gfx::Point(); 28 } 29 GetWindowUnderCursor()30gfx::NativeWindow ScreenMojo::GetWindowUnderCursor() { 31 return GetWindowAtScreenPoint(GetCursorScreenPoint()); 32 } 33 GetWindowAtScreenPoint(const gfx::Point & point)34gfx::NativeWindow ScreenMojo::GetWindowAtScreenPoint(const gfx::Point& point) { 35 NOTIMPLEMENTED(); 36 return NULL; 37 } 38 GetNumDisplays() const39int ScreenMojo::GetNumDisplays() const { 40 return 1; 41 } 42 GetAllDisplays() const43std::vector<gfx::Display> ScreenMojo::GetAllDisplays() const { 44 return std::vector<gfx::Display>(1, display_); 45 } 46 GetDisplayNearestWindow(gfx::NativeWindow window) const47gfx::Display ScreenMojo::GetDisplayNearestWindow( 48 gfx::NativeWindow window) const { 49 return display_; 50 } 51 GetDisplayNearestPoint(const gfx::Point & point) const52gfx::Display ScreenMojo::GetDisplayNearestPoint(const gfx::Point& point) const { 53 return display_; 54 } 55 GetDisplayMatching(const gfx::Rect & match_rect) const56gfx::Display ScreenMojo::GetDisplayMatching(const gfx::Rect& match_rect) const { 57 return display_; 58 } 59 GetPrimaryDisplay() const60gfx::Display ScreenMojo::GetPrimaryDisplay() const { 61 return display_; 62 } 63 AddObserver(gfx::DisplayObserver * observer)64void ScreenMojo::AddObserver(gfx::DisplayObserver* observer) { 65 } 66 RemoveObserver(gfx::DisplayObserver * observer)67void ScreenMojo::RemoveObserver(gfx::DisplayObserver* observer) { 68 } 69 ScreenMojo(const gfx::Rect & screen_bounds)70ScreenMojo::ScreenMojo(const gfx::Rect& screen_bounds) { 71 static int64 synthesized_display_id = 2000; 72 display_.set_id(synthesized_display_id++); 73 display_.SetScaleAndBounds(1.0f, screen_bounds); 74 } 75 76 } // namespace mojo 77