Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(463)

Unified Diff: mojo/services/view_manager/screen_impl.cc

Issue 341953002: Clean up WTH creation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/services/view_manager/screen_impl.h ('k') | mojo/views/native_widget_view_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/services/view_manager/screen_impl.cc
diff --git a/mojo/services/view_manager/screen_impl.cc b/mojo/services/view_manager/screen_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bb2a9303e77a57d223f68c18c286e5e6f09fe69b
--- /dev/null
+++ b/mojo/services/view_manager/screen_impl.cc
@@ -0,0 +1,80 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/services/view_manager/screen_impl.h"
+
+#include "ui/gfx/native_widget_types.h"
+#include "ui/gfx/rect_conversions.h"
+
+namespace mojo {
+namespace view_manager {
+namespace service {
+
+// static
+gfx::Screen* ScreenImpl::Create() {
+ return new ScreenImpl(gfx::Rect(0, 0, 800, 600));
+}
+
+ScreenImpl::~ScreenImpl() {
+}
+
+bool ScreenImpl::IsDIPEnabled() {
+ NOTIMPLEMENTED();
+ return true;
+}
+
+gfx::Point ScreenImpl::GetCursorScreenPoint() {
+ NOTIMPLEMENTED();
+ return gfx::Point();
+}
+
+gfx::NativeWindow ScreenImpl::GetWindowUnderCursor() {
+ return GetWindowAtScreenPoint(GetCursorScreenPoint());
+}
+
+gfx::NativeWindow ScreenImpl::GetWindowAtScreenPoint(const gfx::Point& point) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+int ScreenImpl::GetNumDisplays() const {
+ return 1;
+}
+
+std::vector<gfx::Display> ScreenImpl::GetAllDisplays() const {
+ return std::vector<gfx::Display>(1, display_);
+}
+
+gfx::Display ScreenImpl::GetDisplayNearestWindow(
+ gfx::NativeWindow window) const {
+ return display_;
+}
+
+gfx::Display ScreenImpl::GetDisplayNearestPoint(const gfx::Point& point) const {
+ return display_;
+}
+
+gfx::Display ScreenImpl::GetDisplayMatching(const gfx::Rect& match_rect) const {
+ return display_;
+}
+
+gfx::Display ScreenImpl::GetPrimaryDisplay() const {
+ return display_;
+}
+
+void ScreenImpl::AddObserver(gfx::DisplayObserver* observer) {
+}
+
+void ScreenImpl::RemoveObserver(gfx::DisplayObserver* observer) {
+}
+
+ScreenImpl::ScreenImpl(const gfx::Rect& screen_bounds) {
+ static int64 synthesized_display_id = 2000;
+ display_.set_id(synthesized_display_id++);
+ display_.SetScaleAndBounds(1.0f, screen_bounds);
+}
+
+} // namespace service
+} // namespace view_manager
+} // namespace mojo
« no previous file with comments | « mojo/services/view_manager/screen_impl.h ('k') | mojo/views/native_widget_view_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698