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

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

Issue 53553003: WIP: Ash IME support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 1 month 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
« no previous file with comments | « no previous file | ui/aura/remote_root_window_host_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 OnImeCandidatePopupChanged(bool visible);
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 void OnImeInputSourceChanged(uint16 language_id, bool is_ime);
202
187 // RootWindowHost overrides: 203 // RootWindowHost overrides:
188 virtual RootWindow* GetRootWindow() OVERRIDE; 204 virtual RootWindow* GetRootWindow() OVERRIDE;
189 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; 205 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
190 virtual void Show() OVERRIDE; 206 virtual void Show() OVERRIDE;
191 virtual void Hide() OVERRIDE; 207 virtual void Hide() OVERRIDE;
192 virtual void ToggleFullScreen() OVERRIDE; 208 virtual void ToggleFullScreen() OVERRIDE;
193 virtual gfx::Rect GetBounds() const OVERRIDE; 209 virtual gfx::Rect GetBounds() const OVERRIDE;
194 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; 210 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
195 virtual gfx::Insets GetInsets() const OVERRIDE; 211 virtual gfx::Insets GetInsets() const OVERRIDE;
196 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE; 212 virtual void SetInsets(const gfx::Insets& insets) OVERRIDE;
197 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE; 213 virtual gfx::Point GetLocationOnNativeScreen() const OVERRIDE;
198 virtual void SetCapture() OVERRIDE; 214 virtual void SetCapture() OVERRIDE;
199 virtual void ReleaseCapture() OVERRIDE; 215 virtual void ReleaseCapture() OVERRIDE;
200 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE; 216 virtual void SetCursor(gfx::NativeCursor cursor) OVERRIDE;
201 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE; 217 virtual bool QueryMouseLocation(gfx::Point* location_return) OVERRIDE;
202 virtual bool ConfineCursorToRootWindow() OVERRIDE; 218 virtual bool ConfineCursorToRootWindow() OVERRIDE;
203 virtual void UnConfineCursor() OVERRIDE; 219 virtual void UnConfineCursor() OVERRIDE;
204 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE; 220 virtual void OnCursorVisibilityChanged(bool show) OVERRIDE;
205 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE; 221 virtual void MoveCursorTo(const gfx::Point& location) OVERRIDE;
206 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE; 222 virtual void PostNativeEvent(const base::NativeEvent& native_event) OVERRIDE;
207 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE; 223 virtual void OnDeviceScaleFactorChanged(float device_scale_factor) OVERRIDE;
208 virtual void PrepareForShutdown() OVERRIDE; 224 virtual void PrepareForShutdown() OVERRIDE;
209 225
226 // ui::internal::RemoteInputMethodDelegateWin overrides:
227 virtual void CancelComposition() OVERRIDE;
228 virtual void OnTextInputClientUpdated(
229 const std::vector<int32>& input_scopes,
230 const std::vector<gfx::Rect>& composition_character_bounds) OVERRIDE;
231
210 // Helper function to dispatch a keyboard message to the desired target. 232 // Helper function to dispatch a keyboard message to the desired target.
211 // The default target is the RootWindowHostDelegate. For nested message loop 233 // The default target is the RootWindowHostDelegate. For nested message loop
212 // invocations we post a synthetic keyboard message directly into the message 234 // invocations we post a synthetic keyboard message directly into the message
213 // loop. The dispatcher for the nested loop would then decide how this 235 // loop. The dispatcher for the nested loop would then decide how this
214 // message is routed. 236 // message is routed.
215 void DispatchKeyboardMessage(ui::EventType type, 237 void DispatchKeyboardMessage(ui::EventType type,
216 uint32 vkey, 238 uint32 vkey,
217 uint32 repeat_count, 239 uint32 repeat_count,
218 uint32 scan_code, 240 uint32 scan_code,
219 uint32 flags, 241 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 283 // State of the keyboard/mouse at the time of the last input event. See
262 // description of SetEventFlags(). 284 // description of SetEventFlags().
263 uint32 event_flags_; 285 uint32 event_flags_;
264 286
265 DISALLOW_COPY_AND_ASSIGN(RemoteRootWindowHostWin); 287 DISALLOW_COPY_AND_ASSIGN(RemoteRootWindowHostWin);
266 }; 288 };
267 289
268 } // namespace aura 290 } // namespace aura
269 291
270 #endif // UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ 292 #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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698