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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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/examples/aura_demo/demo_screen.h"
6
7 #include "ui/gfx/native_widget_types.h"
8 #include "ui/gfx/rect_conversions.h"
9
10 namespace mojo {
11 namespace examples {
12
13 // static
14 DemoScreen* DemoScreen::Create() {
15 return new DemoScreen(gfx::Rect(0, 0, 800, 600));
16 }
17
18 DemoScreen::~DemoScreen() {
19 }
20
21 bool DemoScreen::IsDIPEnabled() {
22 NOTIMPLEMENTED();
23 return true;
24 }
25
26 gfx::Point DemoScreen::GetCursorScreenPoint() {
27 NOTIMPLEMENTED();
28 return gfx::Point();
29 }
30
31 gfx::NativeWindow DemoScreen::GetWindowUnderCursor() {
32 return GetWindowAtScreenPoint(GetCursorScreenPoint());
33 }
34
35 gfx::NativeWindow DemoScreen::GetWindowAtScreenPoint(const gfx::Point& point) {
36 NOTIMPLEMENTED();
37 return NULL;
38 }
39
40 int DemoScreen::GetNumDisplays() const {
41 return 1;
42 }
43
44 std::vector<gfx::Display> DemoScreen::GetAllDisplays() const {
45 return std::vector<gfx::Display>(1, display_);
46 }
47
48 gfx::Display DemoScreen::GetDisplayNearestWindow(
49 gfx::NativeWindow window) const {
50 return display_;
51 }
52
53 gfx::Display DemoScreen::GetDisplayNearestPoint(const gfx::Point& point) const {
54 return display_;
55 }
56
57 gfx::Display DemoScreen::GetDisplayMatching(const gfx::Rect& match_rect) const {
58 return display_;
59 }
60
61 gfx::Display DemoScreen::GetPrimaryDisplay() const {
62 return display_;
63 }
64
65 void DemoScreen::AddObserver(gfx::DisplayObserver* observer) {
66 }
67
68 void DemoScreen::RemoveObserver(gfx::DisplayObserver* observer) {
69 }
70
71 DemoScreen::DemoScreen(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 examples
78 } // namespace mojo
OLDNEW
« 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