OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef AURA_DESKTOP_H_ | 5 #ifndef AURA_DESKTOP_H_ |
6 #define AURA_DESKTOP_H_ | 6 #define AURA_DESKTOP_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "aura/window.h" | 9 #include "aura/root_window.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
13 | 13 |
14 namespace gfx { | 14 namespace gfx { |
15 class Size; | 15 class Size; |
16 } | 16 } |
17 | 17 |
18 namespace ui { | 18 namespace ui { |
19 class Compositor; | 19 class Compositor; |
20 } | 20 } |
21 | 21 |
22 namespace aura { | 22 namespace aura { |
23 | 23 |
24 class DesktopHost; | 24 class DesktopHost; |
25 class MouseEvent; | 25 class MouseEvent; |
26 class Window; | |
27 | 26 |
28 // Desktop is responsible for hosting a set of windows. | 27 // Desktop is responsible for hosting a set of windows. |
29 class Desktop { | 28 class Desktop { |
30 public: | 29 public: |
31 Desktop(); | 30 Desktop(); |
32 ~Desktop(); | 31 ~Desktop(); |
33 | 32 |
| 33 // Shows the desktop host. |
| 34 void Show(); |
| 35 |
| 36 // Sets the size of the desktop. |
| 37 void SetSize(const gfx::Size& size); |
| 38 |
34 // Shows the desktop host and runs an event loop for it. | 39 // Shows the desktop host and runs an event loop for it. |
35 void Run(); | 40 void Run(); |
36 | 41 |
37 // Draws the necessary set of windows. | 42 // Draws the necessary set of windows. |
38 void Draw(); | 43 void Draw(); |
39 | 44 |
40 // Handles a mouse event. Returns true if handled. | 45 // Handles a mouse event. Returns true if handled. |
41 bool OnMouseEvent(const MouseEvent& event); | 46 bool OnMouseEvent(const MouseEvent& event); |
42 | 47 |
43 // Compositor we're drawing to. | 48 // Compositor we're drawing to. |
44 ui::Compositor* compositor() { return compositor_.get(); } | 49 ui::Compositor* compositor() { return compositor_.get(); } |
45 | 50 |
46 Window* window() { return window_.get(); } | 51 Window* window() { return window_.get(); } |
47 | 52 |
48 static Desktop* GetInstance(); | 53 static Desktop* GetInstance(); |
49 | 54 |
50 private: | 55 private: |
51 scoped_refptr<ui::Compositor> compositor_; | 56 scoped_refptr<ui::Compositor> compositor_; |
52 | 57 |
53 scoped_ptr<Window> window_; | 58 scoped_ptr<internal::RootWindow> window_; |
54 | 59 |
55 DesktopHost* host_; | 60 DesktopHost* host_; |
56 | 61 |
57 static Desktop* instance_; | 62 static Desktop* instance_; |
58 | 63 |
59 DISALLOW_COPY_AND_ASSIGN(Desktop); | 64 DISALLOW_COPY_AND_ASSIGN(Desktop); |
60 }; | 65 }; |
61 | 66 |
62 } // namespace aura | 67 } // namespace aura |
63 | 68 |
64 #endif // AURA_DESKTOP_H_ | 69 #endif // AURA_DESKTOP_H_ |
OLD | NEW |