| 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 6634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6645 char_event.windowsKeyCode = text[i]; | 6645 char_event.windowsKeyCode = text[i]; |
| 6646 char_event.nativeKeyCode = text[i]; | 6646 char_event.nativeKeyCode = text[i]; |
| 6647 | 6647 |
| 6648 const int32_t char_start = i; | 6648 const int32_t char_start = i; |
| 6649 for (; i < iterator.array_pos(); ++i) { | 6649 for (; i < iterator.array_pos(); ++i) { |
| 6650 char_event.text[i - char_start] = text[i]; | 6650 char_event.text[i - char_start] = text[i]; |
| 6651 char_event.unmodifiedText[i - char_start] = text[i]; | 6651 char_event.unmodifiedText[i - char_start] = text[i]; |
| 6652 } | 6652 } |
| 6653 | 6653 |
| 6654 if (GetRenderWidget()->GetWebWidget()) | 6654 if (GetRenderWidget()->GetWebWidget()) |
| 6655 GetRenderWidget()->GetWebWidget()->handleInputEvent(char_event); | 6655 GetRenderWidget()->GetWebWidget()->handleInputEvent( |
| 6656 blink::WebCoalescedInputEvent(char_event)); |
| 6656 } | 6657 } |
| 6657 } else { | 6658 } else { |
| 6658 // Mimics the order of events sent by WebKit. | 6659 // Mimics the order of events sent by WebKit. |
| 6659 // See WebCore::Editor::setComposition() for the corresponding code. | 6660 // See WebCore::Editor::setComposition() for the corresponding code. |
| 6660 focused_pepper_plugin_->HandleCompositionEnd(text); | 6661 focused_pepper_plugin_->HandleCompositionEnd(text); |
| 6661 focused_pepper_plugin_->HandleTextInput(text); | 6662 focused_pepper_plugin_->HandleTextInput(text); |
| 6662 } | 6663 } |
| 6663 pepper_composition_text_.clear(); | 6664 pepper_composition_text_.clear(); |
| 6664 } | 6665 } |
| 6665 #endif // ENABLE_PLUGINS | 6666 #endif // ENABLE_PLUGINS |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6879 // event target. Potentially a Pepper plugin will receive the event. | 6880 // event target. Potentially a Pepper plugin will receive the event. |
| 6880 // In order to tell whether a plugin gets the last mouse event and which it | 6881 // In order to tell whether a plugin gets the last mouse event and which it |
| 6881 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6882 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6882 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6883 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6883 // |pepper_last_mouse_event_target_|. | 6884 // |pepper_last_mouse_event_target_|. |
| 6884 pepper_last_mouse_event_target_ = nullptr; | 6885 pepper_last_mouse_event_target_ = nullptr; |
| 6885 #endif | 6886 #endif |
| 6886 } | 6887 } |
| 6887 | 6888 |
| 6888 } // namespace content | 6889 } // namespace content |
| OLD | NEW |