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_root_window_host_win.h" | 5 #include "ui/aura/remote_root_window_host_win.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 SetKeyState(keyboard_state, !!(flags & ui::EF_LEFT_MOUSE_BUTTON), VK_LBUTTON); | 54 SetKeyState(keyboard_state, !!(flags & ui::EF_LEFT_MOUSE_BUTTON), VK_LBUTTON); |
55 SetKeyState(keyboard_state, !!(flags & ui::EF_RIGHT_MOUSE_BUTTON), | 55 SetKeyState(keyboard_state, !!(flags & ui::EF_RIGHT_MOUSE_BUTTON), |
56 VK_RBUTTON); | 56 VK_RBUTTON); |
57 SetKeyState(keyboard_state, !!(flags & ui::EF_MIDDLE_MOUSE_BUTTON), | 57 SetKeyState(keyboard_state, !!(flags & ui::EF_MIDDLE_MOUSE_BUTTON), |
58 VK_MBUTTON); | 58 VK_MBUTTON); |
59 | 59 |
60 ::SetKeyboardState(keyboard_state); | 60 ::SetKeyboardState(keyboard_state); |
61 } | 61 } |
62 | 62 |
63 void FillCompositionText( | 63 void FillCompositionText( |
64 const string16& text, | 64 const base::string16& text, |
65 int32 selection_start, | 65 int32 selection_start, |
66 int32 selection_end, | 66 int32 selection_end, |
67 const std::vector<metro_viewer::UnderlineInfo>& underlines, | 67 const std::vector<metro_viewer::UnderlineInfo>& underlines, |
68 ui::CompositionText* composition_text) { | 68 ui::CompositionText* composition_text) { |
69 composition_text->Clear(); | 69 composition_text->Clear(); |
70 composition_text->text = text; | 70 composition_text->text = text; |
71 composition_text->selection.set_start(selection_start); | 71 composition_text->selection.set_start(selection_start); |
72 composition_text->selection.set_end(selection_end); | 72 composition_text->selection.set_end(selection_end); |
73 composition_text->underlines.resize(underlines.size()); | 73 composition_text->underlines.resize(underlines.size()); |
74 for (size_t i = 0; i < underlines.size(); ++i) { | 74 for (size_t i = 0; i < underlines.size(); ++i) { |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
645 | 645 |
646 void RemoteRootWindowHostWin::OnImeCandidatePopupChanged(bool visible) { | 646 void RemoteRootWindowHostWin::OnImeCandidatePopupChanged(bool visible) { |
647 ui::RemoteInputMethodPrivateWin* remote_input_method_private = | 647 ui::RemoteInputMethodPrivateWin* remote_input_method_private = |
648 GetRemoteInputMethodPrivate(); | 648 GetRemoteInputMethodPrivate(); |
649 if (!remote_input_method_private) | 649 if (!remote_input_method_private) |
650 return; | 650 return; |
651 remote_input_method_private->OnCandidatePopupChanged(visible); | 651 remote_input_method_private->OnCandidatePopupChanged(visible); |
652 } | 652 } |
653 | 653 |
654 void RemoteRootWindowHostWin::OnImeCompositionChanged( | 654 void RemoteRootWindowHostWin::OnImeCompositionChanged( |
655 const string16& text, | 655 const base::string16& text, |
656 int32 selection_start, | 656 int32 selection_start, |
657 int32 selection_end, | 657 int32 selection_end, |
658 const std::vector<metro_viewer::UnderlineInfo>& underlines) { | 658 const std::vector<metro_viewer::UnderlineInfo>& underlines) { |
659 ui::RemoteInputMethodPrivateWin* remote_input_method_private = | 659 ui::RemoteInputMethodPrivateWin* remote_input_method_private = |
660 GetRemoteInputMethodPrivate(); | 660 GetRemoteInputMethodPrivate(); |
661 if (!remote_input_method_private) | 661 if (!remote_input_method_private) |
662 return; | 662 return; |
663 ui::CompositionText composition_text; | 663 ui::CompositionText composition_text; |
664 FillCompositionText( | 664 FillCompositionText( |
665 text, selection_start, selection_end, underlines, &composition_text); | 665 text, selection_start, selection_end, underlines, &composition_text); |
666 remote_input_method_private->OnCompositionChanged(composition_text); | 666 remote_input_method_private->OnCompositionChanged(composition_text); |
667 } | 667 } |
668 | 668 |
669 void RemoteRootWindowHostWin::OnImeTextCommitted(const string16& text) { | 669 void RemoteRootWindowHostWin::OnImeTextCommitted(const base::string16& text) { |
670 ui::RemoteInputMethodPrivateWin* remote_input_method_private = | 670 ui::RemoteInputMethodPrivateWin* remote_input_method_private = |
671 GetRemoteInputMethodPrivate(); | 671 GetRemoteInputMethodPrivate(); |
672 if (!remote_input_method_private) | 672 if (!remote_input_method_private) |
673 return; | 673 return; |
674 remote_input_method_private->OnTextCommitted(text); | 674 remote_input_method_private->OnTextCommitted(text); |
675 } | 675 } |
676 | 676 |
677 void RemoteRootWindowHostWin::OnImeInputSourceChanged(uint16 language_id, | 677 void RemoteRootWindowHostWin::OnImeInputSourceChanged(uint16 language_id, |
678 bool is_ime) { | 678 bool is_ime) { |
679 ui::RemoteInputMethodPrivateWin* remote_input_method_private = | 679 ui::RemoteInputMethodPrivateWin* remote_input_method_private = |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
713 } | 713 } |
714 | 714 |
715 void RemoteRootWindowHostWin::SetEventFlags(uint32 flags) { | 715 void RemoteRootWindowHostWin::SetEventFlags(uint32 flags) { |
716 if (flags == event_flags_) | 716 if (flags == event_flags_) |
717 return; | 717 return; |
718 event_flags_ = flags; | 718 event_flags_ = flags; |
719 SetVirtualKeyStates(event_flags_); | 719 SetVirtualKeyStates(event_flags_); |
720 } | 720 } |
721 | 721 |
722 } // namespace aura | 722 } // namespace aura |
OLD | NEW |