| 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 UI_AURA_DESKTOP_H_ | 5 #ifndef UI_AURA_DESKTOP_H_ |
| 6 #define UI_AURA_DESKTOP_H_ | 6 #define UI_AURA_DESKTOP_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/task.h" | 11 #include "base/task.h" |
| 12 #include "ui/aura/aura_export.h" |
| 13 #include "ui/aura/cursor.h" |
| 12 #include "ui/aura/root_window.h" | 14 #include "ui/aura/root_window.h" |
| 13 #include "ui/aura/aura_export.h" | |
| 14 #include "ui/gfx/compositor/compositor.h" | 15 #include "ui/gfx/compositor/compositor.h" |
| 15 #include "ui/gfx/native_widget_types.h" | 16 #include "ui/gfx/native_widget_types.h" |
| 16 | 17 |
| 17 namespace gfx { | 18 namespace gfx { |
| 18 class Size; | 19 class Size; |
| 19 } | 20 } |
| 20 | 21 |
| 21 namespace aura { | 22 namespace aura { |
| 22 | 23 |
| 23 class DesktopHost; | 24 class DesktopHost; |
| 24 class MouseEvent; | 25 class MouseEvent; |
| 25 | 26 |
| 26 // Desktop is responsible for hosting a set of windows. | 27 // Desktop is responsible for hosting a set of windows. |
| 27 class AURA_EXPORT Desktop : public ui::CompositorDelegate { | 28 class AURA_EXPORT Desktop : public ui::CompositorDelegate { |
| 28 public: | 29 public: |
| 29 Desktop(); | 30 Desktop(); |
| 30 ~Desktop(); | 31 ~Desktop(); |
| 31 | 32 |
| 32 // Initializes the desktop. | 33 // Initializes the desktop. |
| 33 void Init(); | 34 void Init(); |
| 34 | 35 |
| 35 // Shows the desktop host. | 36 // Shows the desktop host. |
| 36 void Show(); | 37 void Show(); |
| 37 | 38 |
| 38 // Sets the size of the desktop. | 39 // Sets the size of the desktop. |
| 39 void SetSize(const gfx::Size& size); | 40 void SetSize(const gfx::Size& size); |
| 40 | 41 |
| 42 // Shows the specified cursor. |
| 43 void SetCursor(CursorType cursor_type); |
| 44 |
| 41 // Shows the desktop host and runs an event loop for it. | 45 // Shows the desktop host and runs an event loop for it. |
| 42 void Run(); | 46 void Run(); |
| 43 | 47 |
| 44 // Draws the necessary set of windows. | 48 // Draws the necessary set of windows. |
| 45 void Draw(); | 49 void Draw(); |
| 46 | 50 |
| 47 // Handles a mouse event. Returns true if handled. | 51 // Handles a mouse event. Returns true if handled. |
| 48 bool OnMouseEvent(const MouseEvent& event); | 52 bool OnMouseEvent(const MouseEvent& event); |
| 49 | 53 |
| 50 // Handles a key event. Returns true if handled. | 54 // Handles a key event. Returns true if handled. |
| (...skipping 29 matching lines...) Expand all Loading... |
| 80 | 84 |
| 81 // Used to schedule painting. | 85 // Used to schedule painting. |
| 82 ScopedRunnableMethodFactory<Desktop> schedule_paint_; | 86 ScopedRunnableMethodFactory<Desktop> schedule_paint_; |
| 83 | 87 |
| 84 DISALLOW_COPY_AND_ASSIGN(Desktop); | 88 DISALLOW_COPY_AND_ASSIGN(Desktop); |
| 85 }; | 89 }; |
| 86 | 90 |
| 87 } // namespace aura | 91 } // namespace aura |
| 88 | 92 |
| 89 #endif // UI_AURA_DESKTOP_H_ | 93 #endif // UI_AURA_DESKTOP_H_ |
| OLD | NEW |