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

Unified Diff: mojo/examples/aura_demo/demo_screen.cc

Issue 120503003: run aura_demo as a mojo app (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 11 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/examples/aura_demo/demo_screen.h ('k') | mojo/examples/aura_demo/root_window_host_mojo.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/examples/aura_demo/demo_screen.cc
diff --git a/mojo/examples/aura_demo/demo_screen.cc b/mojo/examples/aura_demo/demo_screen.cc
new file mode 100644
index 0000000000000000000000000000000000000000..bc662868296e1f8204da697baeabec446ff9f807
--- /dev/null
+++ b/mojo/examples/aura_demo/demo_screen.cc
@@ -0,0 +1,78 @@
+// 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/examples/aura_demo/demo_screen.h"
+
+#include "ui/gfx/native_widget_types.h"
+#include "ui/gfx/rect_conversions.h"
+
+namespace mojo {
+namespace examples {
+
+// static
+DemoScreen* DemoScreen::Create() {
+ return new DemoScreen(gfx::Rect(0, 0, 800, 600));
+}
+
+DemoScreen::~DemoScreen() {
+}
+
+bool DemoScreen::IsDIPEnabled() {
+ NOTIMPLEMENTED();
+ return true;
+}
+
+gfx::Point DemoScreen::GetCursorScreenPoint() {
+ NOTIMPLEMENTED();
+ return gfx::Point();
+}
+
+gfx::NativeWindow DemoScreen::GetWindowUnderCursor() {
+ return GetWindowAtScreenPoint(GetCursorScreenPoint());
+}
+
+gfx::NativeWindow DemoScreen::GetWindowAtScreenPoint(const gfx::Point& point) {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+int DemoScreen::GetNumDisplays() const {
+ return 1;
+}
+
+std::vector<gfx::Display> DemoScreen::GetAllDisplays() const {
+ return std::vector<gfx::Display>(1, display_);
+}
+
+gfx::Display DemoScreen::GetDisplayNearestWindow(
+ gfx::NativeWindow window) const {
+ return display_;
+}
+
+gfx::Display DemoScreen::GetDisplayNearestPoint(const gfx::Point& point) const {
+ return display_;
+}
+
+gfx::Display DemoScreen::GetDisplayMatching(const gfx::Rect& match_rect) const {
+ return display_;
+}
+
+gfx::Display DemoScreen::GetPrimaryDisplay() const {
+ return display_;
+}
+
+void DemoScreen::AddObserver(gfx::DisplayObserver* observer) {
+}
+
+void DemoScreen::RemoveObserver(gfx::DisplayObserver* observer) {
+}
+
+DemoScreen::DemoScreen(const gfx::Rect& screen_bounds) {
+ static int64 synthesized_display_id = 2000;
+ display_.set_id(synthesized_display_id++);
+ display_.SetScaleAndBounds(1.0f, screen_bounds);
+}
+
+} // namespace examples
+} // namespace mojo
« no previous file with comments | « mojo/examples/aura_demo/demo_screen.h ('k') | mojo/examples/aura_demo/root_window_host_mojo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698