OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_REMOTE_ROOT_WINDOW_HOST_WIN_H_ | 5 #ifndef UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ |
6 #define UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ | 6 #define UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
13 #include "ui/aura/window_tree_host.h" | 13 #include "ui/aura/window_tree_host.h" |
| 14 #include "ui/base/ime/remote_input_method_delegate_win.h" |
14 #include "ui/events/event.h" | 15 #include "ui/events/event.h" |
15 #include "ui/events/event_constants.h" | 16 #include "ui/events/event_constants.h" |
16 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
| 18 #include "ui/metro_viewer/ime_types.h" |
17 | 19 |
18 namespace base { | 20 namespace base { |
19 class FilePath; | 21 class FilePath; |
20 } | 22 } |
21 | 23 |
22 namespace ui { | 24 namespace ui { |
| 25 class RemoteInputMethodPrivateWin; |
23 class ViewProp; | 26 class ViewProp; |
24 } | 27 } |
25 | 28 |
26 namespace IPC { | 29 namespace IPC { |
27 class Message; | 30 class Message; |
28 class Sender; | 31 class Sender; |
29 } | 32 } |
30 | 33 |
31 namespace aura { | 34 namespace aura { |
32 | 35 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 | 88 |
86 // Handles the activate desktop command for Metro Chrome Ash. The on_success | 89 // Handles the activate desktop command for Metro Chrome Ash. The on_success |
87 // callback passed in is invoked when activation is completed. | 90 // callback passed in is invoked when activation is completed. |
88 AURA_EXPORT void HandleActivateDesktop( | 91 AURA_EXPORT void HandleActivateDesktop( |
89 const base::FilePath& shortcut, | 92 const base::FilePath& shortcut, |
90 const ActivateDesktopCompleted& on_success); | 93 const ActivateDesktopCompleted& on_success); |
91 | 94 |
92 // RootWindowHost implementaton that receives events from a different | 95 // RootWindowHost implementaton that receives events from a different |
93 // process. In the case of Windows this is the Windows 8 (aka Metro) | 96 // process. In the case of Windows this is the Windows 8 (aka Metro) |
94 // frontend process, which forwards input events to this class. | 97 // frontend process, which forwards input events to this class. |
95 class AURA_EXPORT RemoteRootWindowHostWin : public RootWindowHost { | 98 class AURA_EXPORT RemoteRootWindowHostWin |
| 99 : public RootWindowHost, |
| 100 public ui::internal::RemoteInputMethodDelegateWin { |
96 public: | 101 public: |
97 // Returns the only RemoteRootWindowHostWin, if this is the first time | 102 // Returns the only RemoteRootWindowHostWin, if this is the first time |
98 // this function is called, it will call Create() wiht empty bounds. | 103 // this function is called, it will call Create() wiht empty bounds. |
99 static RemoteRootWindowHostWin* Instance(); | 104 static RemoteRootWindowHostWin* Instance(); |
100 static RemoteRootWindowHostWin* Create(const gfx::Rect& bounds); | 105 static RemoteRootWindowHostWin* Create(const gfx::Rect& bounds); |
101 | 106 |
102 // Called when the remote process has established its IPC connection. | 107 // Called when the remote process has established its IPC connection. |
103 // The |host| can be used when we need to send a message to it and | 108 // The |host| can be used when we need to send a message to it and |
104 // |remote_window| is the actual window owned by the viewer process. | 109 // |remote_window| is the actual window owned by the viewer process. |
105 void Connected(IPC::Sender* host, HWND remote_window); | 110 void Connected(IPC::Sender* host, HWND remote_window); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 void OnFileSaveAsDone(bool success, | 183 void OnFileSaveAsDone(bool success, |
179 const base::FilePath& filename, | 184 const base::FilePath& filename, |
180 int filter_index); | 185 int filter_index); |
181 void OnFileOpenDone(bool success, const base::FilePath& filename); | 186 void OnFileOpenDone(bool success, const base::FilePath& filename); |
182 void OnMultiFileOpenDone(bool success, | 187 void OnMultiFileOpenDone(bool success, |
183 const std::vector<base::FilePath>& files); | 188 const std::vector<base::FilePath>& files); |
184 void OnSelectFolderDone(bool success, const base::FilePath& folder); | 189 void OnSelectFolderDone(bool success, const base::FilePath& folder); |
185 void OnSetCursorPosAck(); | 190 void OnSetCursorPosAck(); |
186 void OnDesktopActivated(); | 191 void OnDesktopActivated(); |
187 | 192 |
| 193 // For Input Method support: |
| 194 ui::RemoteInputMethodPrivateWin* GetRemoteInputMethodPrivate(); |
| 195 void OnImeCompositionChanged( |
| 196 const string16& text, |
| 197 int32 selection_start, |
| 198 int32 selection_end, |
| 199 const std::vector<metro_viewer::UnderlineInfo>& underlines); |
| 200 void OnImeTextCommitted(const string16& text); |
| 201 |
188 // RootWindowHost overrides: | 202 // RootWindowHost overrides: |
189 virtual RootWindow* GetRootWindow() OVERRIDE; | 203 virtual RootWindow* GetRootWindow() OVERRIDE; |
190 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; | 204 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; |
191 virtual void Show() OVERRIDE; | 205 virtual void Show() OVERRIDE; |
192 virtual void Hide() OVERRIDE; | 206 virtual void Hide() OVERRIDE; |
193 virtual void ToggleFullScreen() OVERRIDE; | 207 virtual void ToggleFullScreen() OVERRIDE; |
194 virtual gfx::Rect GetBounds() const OVERRIDE; | 208 virtual gfx::Rect GetBounds() const OVERRIDE; |
195 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; | 209 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; |
196 virtual gfx::Insets GetInsets() const OVERRIDE; | 210 virtual gfx::Insets GetInsets() const OVERRIDE; |
197 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE; | 211 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE; |
198 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; | 212 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; |
199 virtual void SetCapture() OVERRIDE; | 213 virtual void SetCapture() OVERRIDE; |
200 virtual void ReleaseCapture() OVERRIDE; | 214 virtual void ReleaseCapture() OVERRIDE; |
201 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; | 215 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; |
202 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE; | 216 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE; |
203 virtual bool ConfineCursorToRootWindow() OVERRIDE; | 217 virtual bool ConfineCursorToRootWindow() OVERRIDE; |
204 virtual void UnConfineCursor() OVERRIDE; | 218 virtual void UnConfineCursor() OVERRIDE; |
205 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE; | 219 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE; |
206 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; | 220 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; |
207 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; | 221 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; |
208 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; | 222 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; |
209 virtual void PrepareForShutdown() OVERRIDE; | 223 virtual void PrepareForShutdown() OVERRIDE; |
210 | 224 |
| 225 // ui::internal::RemoteInputMethodDelegateWin overrides: |
| 226 virtual void CancelComposition() OVERRIDE; |
| 227 virtual void OnTextInputClientUpdated( |
| 228 const std::vector<int32>& input_scopes, |
| 229 const std::vector<gfx::Rect>& composition_character_bounds) OVERRIDE; |
| 230 |
211 // Helper function to dispatch a keyboard message to the desired target. | 231 // Helper function to dispatch a keyboard message to the desired target. |
212 // The default target is the RootWindowHostDelegate. For nested message loop | 232 // The default target is the RootWindowHostDelegate. For nested message loop |
213 // invocations we post a synthetic keyboard message directly into the message | 233 // invocations we post a synthetic keyboard message directly into the message |
214 // loop. The dispatcher for the nested loop would then decide how this | 234 // loop. The dispatcher for the nested loop would then decide how this |
215 // message is routed. | 235 // message is routed. |
216 void DispatchKeyboardMessage(ui::EventType type, | 236 void DispatchKeyboardMessage(ui::EventType type, |
217 uint32 vkey, | 237 uint32 vkey, |
218 uint32 repeat_count, | 238 uint32 repeat_count, |
219 uint32 scan_code, | 239 uint32 scan_code, |
220 uint32 flags, | 240 uint32 flags, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 | 285 |
266 // Current size of this root window. | 286 // Current size of this root window. |
267 gfx::Size window_size_; | 287 gfx::Size window_size_; |
268 | 288 |
269 DISALLOW_COPY_AND_ASSIGN(RemoteRootWindowHostWin); | 289 DISALLOW_COPY_AND_ASSIGN(RemoteRootWindowHostWin); |
270 }; | 290 }; |
271 | 291 |
272 } // namespace aura | 292 } // namespace aura |
273 | 293 |
274 #endif // UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ | 294 #endif // UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ |
OLD | NEW |