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 #include "ui/aura/remote_window_tree_host_win.h" | 5 #include "ui/aura/remote_window_tree_host_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
11 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
12 #include "ipc/ipc_message.h" | 12 #include "ipc/ipc_message.h" |
13 #include "ipc/ipc_sender.h" | 13 #include "ipc/ipc_sender.h" |
14 #include "ui/aura/client/aura_constants.h" | |
15 #include "ui/aura/client/cursor_client.h" | 14 #include "ui/aura/client/cursor_client.h" |
16 #include "ui/aura/window_event_dispatcher.h" | 15 #include "ui/aura/window_event_dispatcher.h" |
17 #include "ui/aura/window_property.h" | 16 #include "ui/aura/window_property.h" |
18 #include "ui/base/cursor/cursor_loader_win.h" | 17 #include "ui/base/cursor/cursor_loader_win.h" |
19 #include "ui/base/ime/composition_text.h" | 18 #include "ui/base/ime/composition_text.h" |
20 #include "ui/base/ime/input_method.h" | 19 #include "ui/base/ime/input_method.h" |
21 #include "ui/base/ime/remote_input_method_win.h" | 20 #include "ui/base/ime/remote_input_method_win.h" |
22 #include "ui/base/ime/text_input_client.h" | 21 #include "ui/base/ime/text_input_client.h" |
23 #include "ui/base/view_prop.h" | 22 #include "ui/base/view_prop.h" |
24 #include "ui/events/event_utils.h" | 23 #include "ui/events/event_utils.h" |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
264 // the SetCursor operation completed. | 263 // the SetCursor operation completed. |
265 ignore_mouse_moves_until_set_cursor_ack_++; | 264 ignore_mouse_moves_until_set_cursor_ack_++; |
266 VLOG(1) << "In MoveCursorTo. Sending IPC"; | 265 VLOG(1) << "In MoveCursorTo. Sending IPC"; |
267 host_->Send(new MetroViewerHostMsg_SetCursorPos(location.x(), location.y())); | 266 host_->Send(new MetroViewerHostMsg_SetCursorPos(location.x(), location.y())); |
268 } | 267 } |
269 | 268 |
270 void RemoteWindowTreeHostWin::OnCursorVisibilityChangedNative(bool show) { | 269 void RemoteWindowTreeHostWin::OnCursorVisibilityChangedNative(bool show) { |
271 NOTIMPLEMENTED(); | 270 NOTIMPLEMENTED(); |
272 } | 271 } |
273 | 272 |
274 ui::EventProcessor* RemoteWindowTreeHostWin::GetEventProcessor() { | |
275 return dispatcher(); | |
276 } | |
277 | |
278 void RemoteWindowTreeHostWin::CancelComposition() { | 273 void RemoteWindowTreeHostWin::CancelComposition() { |
279 if (!host_) | 274 if (!host_) |
280 return; | 275 return; |
281 host_->Send(new MetroViewerHostMsg_ImeCancelComposition); | 276 host_->Send(new MetroViewerHostMsg_ImeCancelComposition); |
282 } | 277 } |
283 | 278 |
284 void RemoteWindowTreeHostWin::OnTextInputClientUpdated( | 279 void RemoteWindowTreeHostWin::OnTextInputClientUpdated( |
285 const std::vector<int32>& input_scopes, | 280 const std::vector<int32>& input_scopes, |
286 const std::vector<gfx::Rect>& composition_character_bounds) { | 281 const std::vector<gfx::Rect>& composition_character_bounds) { |
287 if (!host_) | 282 if (!host_) |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
426 SendEventToProcessor(&event); | 421 SendEventToProcessor(&event); |
427 } | 422 } |
428 | 423 |
429 void RemoteWindowTreeHostWin::OnSetCursorPosAck() { | 424 void RemoteWindowTreeHostWin::OnSetCursorPosAck() { |
430 DCHECK_GT(ignore_mouse_moves_until_set_cursor_ack_, 0); | 425 DCHECK_GT(ignore_mouse_moves_until_set_cursor_ack_, 0); |
431 ignore_mouse_moves_until_set_cursor_ack_--; | 426 ignore_mouse_moves_until_set_cursor_ack_--; |
432 } | 427 } |
433 | 428 |
434 ui::RemoteInputMethodPrivateWin* | 429 ui::RemoteInputMethodPrivateWin* |
435 RemoteWindowTreeHostWin::GetRemoteInputMethodPrivate() { | 430 RemoteWindowTreeHostWin::GetRemoteInputMethodPrivate() { |
436 ui::InputMethod* input_method = GetAshWindow()->GetProperty( | 431 ui::InputMethod* input_method = GetAshWindow()->GetHost()->GetInputMethod(); |
James Su
2015/06/02 07:05:26
shouldn't GetAshWindow()->GetHost() == this ?
Shu Chen
2015/06/02 07:20:21
Yes. Done.
| |
437 aura::client::kRootWindowInputMethodKey); | |
438 return ui::RemoteInputMethodPrivateWin::Get(input_method); | 432 return ui::RemoteInputMethodPrivateWin::Get(input_method); |
439 } | 433 } |
440 | 434 |
441 void RemoteWindowTreeHostWin::OnImeCandidatePopupChanged(bool visible) { | 435 void RemoteWindowTreeHostWin::OnImeCandidatePopupChanged(bool visible) { |
442 ui::RemoteInputMethodPrivateWin* remote_input_method_private = | 436 ui::RemoteInputMethodPrivateWin* remote_input_method_private = |
443 GetRemoteInputMethodPrivate(); | 437 GetRemoteInputMethodPrivate(); |
444 if (!remote_input_method_private) | 438 if (!remote_input_method_private) |
445 return; | 439 return; |
446 remote_input_method_private->OnCandidatePopupChanged(visible); | 440 remote_input_method_private->OnCandidatePopupChanged(visible); |
447 } | 441 } |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
512 } | 506 } |
513 | 507 |
514 void RemoteWindowTreeHostWin::SetEventFlags(uint32 flags) { | 508 void RemoteWindowTreeHostWin::SetEventFlags(uint32 flags) { |
515 if (flags == event_flags_) | 509 if (flags == event_flags_) |
516 return; | 510 return; |
517 event_flags_ = flags; | 511 event_flags_ = flags; |
518 SetVirtualKeyStates(event_flags_); | 512 SetVirtualKeyStates(event_flags_); |
519 } | 513 } |
520 | 514 |
521 } // namespace aura | 515 } // namespace aura |
OLD | NEW |