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" |
11 #include "ui/base/ime/input_method_delegate.h" | |
11 #include "ui/gfx/native_widget_types.h" | 12 #include "ui/gfx/native_widget_types.h" |
12 | 13 |
14 namespace ui { | |
15 class InputMethod; | |
16 } | |
17 | |
13 namespace gfx { | 18 namespace gfx { |
14 class Point; | 19 class Point; |
15 class Rect; | 20 class Rect; |
16 class Size; | 21 class Size; |
17 } | 22 } |
18 | 23 |
19 namespace aura { | 24 namespace aura { |
20 | 25 |
21 class Desktop; | 26 class Desktop; |
22 | 27 |
23 // DesktopHost bridges between a native window and the embedded Desktop. It | 28 // 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. | 29 // provides the accelerated widget and maps events from the native os to aura. |
25 class DesktopHost : public MessageLoop::Dispatcher { | 30 class DesktopHost : public MessageLoop::Dispatcher, |
31 public ui::internal::InputMethodDelegate { | |
26 public: | 32 public: |
27 virtual ~DesktopHost() {} | 33 virtual ~DesktopHost() {} |
28 | 34 |
29 // Creates a new DesktopHost. The caller owns the returned value. | 35 // Creates a new DesktopHost. The caller owns the returned value. |
30 static DesktopHost* Create(const gfx::Rect& bounds); | 36 static DesktopHost* Create(const gfx::Rect& bounds); |
31 | 37 |
32 // Returns the actual size of the screen. | 38 // Returns the actual size of the screen. |
33 // (gfx::Screen only reports on the virtual desktop exposed by Aura.) | 39 // (gfx::Screen only reports on the virtual desktop exposed by Aura.) |
34 static gfx::Size GetNativeScreenSize(); | 40 static gfx::Size GetNativeScreenSize(); |
35 | 41 |
(...skipping 21 matching lines...) Expand all Loading... | |
57 virtual void SetCursor(gfx::NativeCursor cursor) = 0; | 63 virtual void SetCursor(gfx::NativeCursor cursor) = 0; |
58 | 64 |
59 // Queries the mouse's current position relative to the host window. | 65 // Queries the mouse's current position relative to the host window. |
60 // The position is constrained within the host window. | 66 // The position is constrained within the host window. |
61 // You should probably call Desktop::last_mouse_location() instead; this | 67 // You should probably call Desktop::last_mouse_location() instead; this |
62 // method can be expensive. | 68 // method can be expensive. |
63 virtual gfx::Point QueryMouseLocation() = 0; | 69 virtual gfx::Point QueryMouseLocation() = 0; |
64 | 70 |
65 // Posts |native_event| to the platform's event queue. | 71 // Posts |native_event| to the platform's event queue. |
66 virtual void PostNativeEvent(const base::NativeEvent& native_event) = 0; | 72 virtual void PostNativeEvent(const base::NativeEvent& native_event) = 0; |
73 | |
74 // Sets the input method for the desktop. DesktopHost owns the input method. | |
75 // The function is only for unit tests. | |
76 virtual void SetInputMethod(ui::InputMethod* input_method) = 0; | |
77 | |
78 // Gets the input method for the desktop. | |
sky
2011/12/01 17:01:09
Document ownership.
Yusuke Sato
2011/12/02 02:18:31
Done.
| |
79 virtual ui::InputMethod* GetInputMethod() const = 0; | |
67 }; | 80 }; |
68 | 81 |
69 } // namespace aura | 82 } // namespace aura |
70 | 83 |
71 #endif // UI_AURA_DESKTOP_HOST_H_ | 84 #endif // UI_AURA_DESKTOP_HOST_H_ |
OLD | NEW |