Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(449)

Side by Side Diff: ui/aura/remote_root_window_host_win.h

Issue 83233002: Enable basic IME functionality under Ash on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comment from ananta. Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 const base::FilePath& filename, 182 const base::FilePath& filename,
178 int filter_index); 183 int filter_index);
179 void OnFileOpenDone(bool success, const base::FilePath& filename); 184 void OnFileOpenDone(bool success, const base::FilePath& filename);
180 void OnMultiFileOpenDone(bool success, 185 void OnMultiFileOpenDone(bool success,
181 const std::vector<base::FilePath>& files); 186 const std::vector<base::FilePath>& files);
182 void OnSelectFolderDone(bool success, const base::FilePath& folder); 187 void OnSelectFolderDone(bool success, const base::FilePath& folder);
183 void OnSetCursorPosAck(); 188 void OnSetCursorPosAck();
184 void OnWindowSizeChanged(uint32 width, uint32 height); 189 void OnWindowSizeChanged(uint32 width, uint32 height);
185 void OnDesktopActivated(); 190 void OnDesktopActivated();
186 191
192 // For Input Method support:
193 ui::RemoteInputMethodPrivateWin* GetRemoteInputMethodPrivate();
194 void OnImeCompositionChanged(
195 const string16& text,
196 int32 selection_start,
197 int32 selection_end,
198 const std::vector<metro_viewer::UnderlineInfo>& underlines);
199 void OnImeTextCommitted(const string16& text);
200
187 // RootWindowHost overrides: 201 // RootWindowHost overrides:
188 virtual RootWindow* GetRootWindow() OVERRIDE; 202 virtual RootWindow* GetRootWindow() OVERRIDE;
189 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; 203 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
190 virtual void Show() OVERRIDE; 204 virtual void Show() OVERRIDE;
191 virtual void Hide() OVERRIDE; 205 virtual void Hide() OVERRIDE;
192 virtual void ToggleFullScreen() OVERRIDE; 206 virtual void ToggleFullScreen() OVERRIDE;
193 virtual gfx::Rect GetBounds() const OVERRIDE; 207 virtual gfx::Rect GetBounds() const OVERRIDE;
194 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; 208 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
195 virtual gfx::Insets GetInsets() const OVERRIDE; 209 virtual gfx::Insets GetInsets() const OVERRIDE;
196 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE; 210 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE;
197 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; 211 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE;
198 virtual void SetCapture() OVERRIDE; 212 virtual void SetCapture() OVERRIDE;
199 virtual void ReleaseCapture() OVERRIDE; 213 virtual void ReleaseCapture() OVERRIDE;
200 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; 214 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE;
201 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE; 215 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE;
202 virtual bool ConfineCursorToRootWindow() OVERRIDE; 216 virtual bool ConfineCursorToRootWindow() OVERRIDE;
203 virtual void UnConfineCursor() OVERRIDE; 217 virtual void UnConfineCursor() OVERRIDE;
204 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE; 218 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE;
205 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; 219 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE;
206 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; 220 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE;
207 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; 221 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
208 virtual void PrepareForShutdown() OVERRIDE; 222 virtual void PrepareForShutdown() OVERRIDE;
209 223
224 // ui::internal::RemoteInputMethodDelegateWin overrides:
225 virtual void CancelComposition() OVERRIDE;
226 virtual void OnTextInputClientUpdated(
227 const std::vector<int32>& input_scopes,
228 const std::vector<gfx::Rect>& composition_character_bounds) OVERRIDE;
229
210 // Helper function to dispatch a keyboard message to the desired target. 230 // Helper function to dispatch a keyboard message to the desired target.
211 // The default target is the RootWindowHostDelegate. For nested message loop 231 // The default target is the RootWindowHostDelegate. For nested message loop
212 // invocations we post a synthetic keyboard message directly into the message 232 // invocations we post a synthetic keyboard message directly into the message
213 // loop. The dispatcher for the nested loop would then decide how this 233 // loop. The dispatcher for the nested loop would then decide how this
214 // message is routed. 234 // message is routed.
215 void DispatchKeyboardMessage(ui::EventType type, 235 void DispatchKeyboardMessage(ui::EventType type,
216 uint32 vkey, 236 uint32 vkey,
217 uint32 repeat_count, 237 uint32 repeat_count,
218 uint32 scan_code, 238 uint32 scan_code,
219 uint32 flags, 239 uint32 flags,
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 // State of the keyboard/mouse at the time of the last input event. See 281 // State of the keyboard/mouse at the time of the last input event. See
262 // description of SetEventFlags(). 282 // description of SetEventFlags().
263 uint32 event_flags_; 283 uint32 event_flags_;
264 284
265 DISALLOW_COPY_AND_ASSIGN(RemoteRootWindowHostWin); 285 DISALLOW_COPY_AND_ASSIGN(RemoteRootWindowHostWin);
266 }; 286 };
267 287
268 } // namespace aura 288 } // namespace aura
269 289
270 #endif // UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ 290 #endif // UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_
OLDNEW
« no previous file with comments | « no previous file | ui/aura/remote_root_window_host_win.cc » ('j') | win8/metro_driver/ime/text_service.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698