| 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_HOST_H_ | 5 #ifndef UI_AURA_DESKTOP_HOST_H_ |
| 6 #define UI_AURA_DESKTOP_HOST_H_ | 6 #define UI_AURA_DESKTOP_HOST_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "ui/aura/cursor.h" | 10 #include "ui/aura/cursor.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 // DesktopHost bridges between a native window and the embedded Desktop. It | 23 // DesktopHost bridges between a native window and the embedded Desktop. It |
| 24 // provides the accelerated widget and maps events from the native os to aura. | 24 // provides the accelerated widget and maps events from the native os to aura. |
| 25 class DesktopHost : public MessageLoop::Dispatcher { | 25 class DesktopHost : public MessageLoop::Dispatcher { |
| 26 public: | 26 public: |
| 27 virtual ~DesktopHost() {} | 27 virtual ~DesktopHost() {} |
| 28 | 28 |
| 29 // Creates a new DesktopHost. The caller owns the returned value. | 29 // Creates a new DesktopHost. The caller owns the returned value. |
| 30 static DesktopHost* Create(const gfx::Rect& bounds); | 30 static DesktopHost* Create(const gfx::Rect& bounds); |
| 31 | 31 |
| 32 // Returns the actual size of the display. |
| 33 // (gfx::Screen only reports on the virtual desktop exposed by Aura.) |
| 34 static gfx::Size GetNativeDisplaySize(); |
| 35 |
| 32 // Sets the Desktop this DesktopHost is hosting. DesktopHost does not own the | 36 // Sets the Desktop this DesktopHost is hosting. DesktopHost does not own the |
| 33 // Desktop. | 37 // Desktop. |
| 34 virtual void SetDesktop(Desktop* desktop) = 0; | 38 virtual void SetDesktop(Desktop* desktop) = 0; |
| 35 | 39 |
| 36 // Returns the accelerated widget. | 40 // Returns the accelerated widget. |
| 37 virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0; | 41 virtual gfx::AcceleratedWidget GetAcceleratedWidget() = 0; |
| 38 | 42 |
| 39 // Shows the DesktopHost. | 43 // Shows the DesktopHost. |
| 40 virtual void Show() = 0; | 44 virtual void Show() = 0; |
| 41 | 45 |
| 42 // Gets/Sets the size of the DesktopHost. | 46 // Gets/Sets the size of the DesktopHost. |
| 43 virtual gfx::Size GetSize() const = 0; | 47 virtual gfx::Size GetSize() const = 0; |
| 44 virtual void SetSize(const gfx::Size& size) = 0; | 48 virtual void SetSize(const gfx::Size& size) = 0; |
| 45 | 49 |
| 46 // Sets the currently displayed cursor. | 50 // Sets the currently displayed cursor. |
| 47 virtual void SetCursor(gfx::NativeCursor cursor) = 0; | 51 virtual void SetCursor(gfx::NativeCursor cursor) = 0; |
| 48 | 52 |
| 49 // Queries the mouse's current position relative to the host window. | 53 // Queries the mouse's current position relative to the host window. |
| 50 // The position is constrained within the host window. | 54 // The position is constrained within the host window. |
| 51 // You should probably call Desktop::last_mouse_location() instead; this | 55 // You should probably call Desktop::last_mouse_location() instead; this |
| 52 // method can be expensive. | 56 // method can be expensive. |
| 53 virtual gfx::Point QueryMouseLocation() = 0; | 57 virtual gfx::Point QueryMouseLocation() = 0; |
| 54 }; | 58 }; |
| 55 | 59 |
| 56 } // namespace aura | 60 } // namespace aura |
| 57 | 61 |
| 58 #endif // UI_AURA_DESKTOP_HOST_H_ | 62 #endif // UI_AURA_DESKTOP_HOST_H_ |
| OLD | NEW |