OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/render_frame_impl.h" | 5 #include "content/renderer/render_frame_impl.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 6530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6541 void RenderFrameImpl::HandlePepperImeCommit(const base::string16& text) { | 6541 void RenderFrameImpl::HandlePepperImeCommit(const base::string16& text) { |
6542 if (text.empty()) | 6542 if (text.empty()) |
6543 return; | 6543 return; |
6544 | 6544 |
6545 if (!IsPepperAcceptingCompositionEvents()) { | 6545 if (!IsPepperAcceptingCompositionEvents()) { |
6546 // For pepper plugins unable to handle IME events, send the plugin a | 6546 // For pepper plugins unable to handle IME events, send the plugin a |
6547 // sequence of characters instead. | 6547 // sequence of characters instead. |
6548 base::i18n::UTF16CharIterator iterator(&text); | 6548 base::i18n::UTF16CharIterator iterator(&text); |
6549 int32_t i = 0; | 6549 int32_t i = 0; |
6550 while (iterator.Advance()) { | 6550 while (iterator.Advance()) { |
6551 blink::WebKeyboardEvent char_event; | 6551 blink::WebKeyboardEvent char_event( |
6552 char_event.type = blink::WebInputEvent::Char; | 6552 blink::WebInputEvent::Char, blink::WebInputEvent::NoModifiers, |
6553 char_event.timeStampSeconds = | 6553 ui::EventTimeStampToSeconds(ui::EventTimeForNow())); |
6554 ui::EventTimeStampToSeconds(ui::EventTimeForNow()); | |
6555 char_event.modifiers = 0; | |
6556 char_event.windowsKeyCode = text[i]; | 6554 char_event.windowsKeyCode = text[i]; |
6557 char_event.nativeKeyCode = text[i]; | 6555 char_event.nativeKeyCode = text[i]; |
6558 | 6556 |
6559 const int32_t char_start = i; | 6557 const int32_t char_start = i; |
6560 for (; i < iterator.array_pos(); ++i) { | 6558 for (; i < iterator.array_pos(); ++i) { |
6561 char_event.text[i - char_start] = text[i]; | 6559 char_event.text[i - char_start] = text[i]; |
6562 char_event.unmodifiedText[i - char_start] = text[i]; | 6560 char_event.unmodifiedText[i - char_start] = text[i]; |
6563 } | 6561 } |
6564 | 6562 |
6565 if (GetRenderWidget()->GetWebWidget()) | 6563 if (GetRenderWidget()->GetWebWidget()) |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6761 // event target. Potentially a Pepper plugin will receive the event. | 6759 // event target. Potentially a Pepper plugin will receive the event. |
6762 // In order to tell whether a plugin gets the last mouse event and which it | 6760 // In order to tell whether a plugin gets the last mouse event and which it |
6763 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6761 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
6764 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6762 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6765 // |pepper_last_mouse_event_target_|. | 6763 // |pepper_last_mouse_event_target_|. |
6766 pepper_last_mouse_event_target_ = nullptr; | 6764 pepper_last_mouse_event_target_ = nullptr; |
6767 #endif | 6765 #endif |
6768 } | 6766 } |
6769 | 6767 |
6770 } // namespace content | 6768 } // namespace content |
OLD | NEW |