| 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 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1442 char_event.windowsKeyCode = text[i]; | 1442 char_event.windowsKeyCode = text[i]; |
| 1443 char_event.nativeKeyCode = text[i]; | 1443 char_event.nativeKeyCode = text[i]; |
| 1444 | 1444 |
| 1445 const int32_t char_start = i; | 1445 const int32_t char_start = i; |
| 1446 for (; i < iterator.array_pos(); ++i) { | 1446 for (; i < iterator.array_pos(); ++i) { |
| 1447 char_event.text[i - char_start] = text[i]; | 1447 char_event.text[i - char_start] = text[i]; |
| 1448 char_event.unmodifiedText[i - char_start] = text[i]; | 1448 char_event.unmodifiedText[i - char_start] = text[i]; |
| 1449 } | 1449 } |
| 1450 | 1450 |
| 1451 if (GetRenderWidget()->GetWebWidget()) | 1451 if (GetRenderWidget()->GetWebWidget()) |
| 1452 GetRenderWidget()->GetWebWidget()->handleInputEvent(char_event); | 1452 GetRenderWidget()->GetWebWidget()->handleInputEvent( |
| 1453 blink::CoalescedWebInputEvent(char_event)); |
| 1453 } | 1454 } |
| 1454 } else { | 1455 } else { |
| 1455 // Mimics the order of events sent by WebKit. | 1456 // Mimics the order of events sent by WebKit. |
| 1456 // See WebCore::Editor::setComposition() for the corresponding code. | 1457 // See WebCore::Editor::setComposition() for the corresponding code. |
| 1457 focused_pepper_plugin_->HandleCompositionEnd(text); | 1458 focused_pepper_plugin_->HandleCompositionEnd(text); |
| 1458 focused_pepper_plugin_->HandleTextInput(text); | 1459 focused_pepper_plugin_->HandleTextInput(text); |
| 1459 } | 1460 } |
| 1460 pepper_composition_text_.clear(); | 1461 pepper_composition_text_.clear(); |
| 1461 } | 1462 } |
| 1462 | 1463 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 1477 char_event.windowsKeyCode = text[i]; | 1478 char_event.windowsKeyCode = text[i]; |
| 1478 char_event.nativeKeyCode = text[i]; | 1479 char_event.nativeKeyCode = text[i]; |
| 1479 | 1480 |
| 1480 const int32_t char_start = i; | 1481 const int32_t char_start = i; |
| 1481 for (; i < iterator.array_pos(); ++i) { | 1482 for (; i < iterator.array_pos(); ++i) { |
| 1482 char_event.text[i - char_start] = text[i]; | 1483 char_event.text[i - char_start] = text[i]; |
| 1483 char_event.unmodifiedText[i - char_start] = text[i]; | 1484 char_event.unmodifiedText[i - char_start] = text[i]; |
| 1484 } | 1485 } |
| 1485 | 1486 |
| 1486 if (GetRenderWidget()->GetWebWidget()) | 1487 if (GetRenderWidget()->GetWebWidget()) |
| 1487 GetRenderWidget()->GetWebWidget()->handleInputEvent(char_event); | 1488 GetRenderWidget()->GetWebWidget()->handleInputEvent( |
| 1489 blink::CoalescedWebInputEvent(char_event)); |
| 1488 } | 1490 } |
| 1489 } else { | 1491 } else { |
| 1490 // Mimics the order of events sent by WebKit. | 1492 // Mimics the order of events sent by WebKit. |
| 1491 // See WebCore::Editor::setComposition() for the corresponding code. | 1493 // See WebCore::Editor::setComposition() for the corresponding code. |
| 1492 focused_pepper_plugin_->HandleCompositionEnd(text); | 1494 focused_pepper_plugin_->HandleCompositionEnd(text); |
| 1493 focused_pepper_plugin_->HandleTextInput(text); | 1495 focused_pepper_plugin_->HandleTextInput(text); |
| 1494 } | 1496 } |
| 1495 pepper_composition_text_.clear(); | 1497 pepper_composition_text_.clear(); |
| 1496 } | 1498 } |
| 1497 #endif // defined(ENABLE_PLUGINS) | 1499 #endif // defined(ENABLE_PLUGINS) |
| (...skipping 5134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6632 // event target. Potentially a Pepper plugin will receive the event. | 6634 // event target. Potentially a Pepper plugin will receive the event. |
| 6633 // In order to tell whether a plugin gets the last mouse event and which it | 6635 // In order to tell whether a plugin gets the last mouse event and which it |
| 6634 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6636 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6635 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6637 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6636 // |pepper_last_mouse_event_target_|. | 6638 // |pepper_last_mouse_event_target_|. |
| 6637 pepper_last_mouse_event_target_ = nullptr; | 6639 pepper_last_mouse_event_target_ = nullptr; |
| 6638 #endif | 6640 #endif |
| 6639 } | 6641 } |
| 6640 | 6642 |
| 6641 } // namespace content | 6643 } // namespace content |
| OLD | NEW |