Chromium Code Reviews| 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 6445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6456 return; | 6456 return; |
| 6457 | 6457 |
| 6458 if (!IsPepperAcceptingCompositionEvents()) { | 6458 if (!IsPepperAcceptingCompositionEvents()) { |
| 6459 // For pepper plugins unable to handle IME events, send the plugin a | 6459 // For pepper plugins unable to handle IME events, send the plugin a |
| 6460 // sequence of characters instead. | 6460 // sequence of characters instead. |
| 6461 base::i18n::UTF16CharIterator iterator(&text); | 6461 base::i18n::UTF16CharIterator iterator(&text); |
| 6462 int32_t i = 0; | 6462 int32_t i = 0; |
| 6463 while (iterator.Advance()) { | 6463 while (iterator.Advance()) { |
| 6464 blink::WebKeyboardEvent char_event; | 6464 blink::WebKeyboardEvent char_event; |
| 6465 char_event.type = blink::WebInputEvent::Char; | 6465 char_event.type = blink::WebInputEvent::Char; |
| 6466 char_event.timeStampSeconds = base::Time::Now().ToDoubleT(); | 6466 char_event.timeStampSeconds = |
| 6467 (base::TimeTicks::Now() - base::TimeTicks()).InSecondsF(); | |
|
majidvp
2016/12/08 20:26:33
nit: Please use ui::EventTimeStampToSeconds to mak
| |
| 6467 char_event.modifiers = 0; | 6468 char_event.modifiers = 0; |
| 6468 char_event.windowsKeyCode = text[i]; | 6469 char_event.windowsKeyCode = text[i]; |
| 6469 char_event.nativeKeyCode = text[i]; | 6470 char_event.nativeKeyCode = text[i]; |
| 6470 | 6471 |
| 6471 const int32_t char_start = i; | 6472 const int32_t char_start = i; |
| 6472 for (; i < iterator.array_pos(); ++i) { | 6473 for (; i < iterator.array_pos(); ++i) { |
| 6473 char_event.text[i - char_start] = text[i]; | 6474 char_event.text[i - char_start] = text[i]; |
| 6474 char_event.unmodifiedText[i - char_start] = text[i]; | 6475 char_event.unmodifiedText[i - char_start] = text[i]; |
| 6475 } | 6476 } |
| 6476 | 6477 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6671 // event target. Potentially a Pepper plugin will receive the event. | 6672 // event target. Potentially a Pepper plugin will receive the event. |
| 6672 // In order to tell whether a plugin gets the last mouse event and which it | 6673 // In order to tell whether a plugin gets the last mouse event and which it |
| 6673 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6674 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6674 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6675 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6675 // |pepper_last_mouse_event_target_|. | 6676 // |pepper_last_mouse_event_target_|. |
| 6676 pepper_last_mouse_event_target_ = nullptr; | 6677 pepper_last_mouse_event_target_ = nullptr; |
| 6677 #endif | 6678 #endif |
| 6678 } | 6679 } |
| 6679 | 6680 |
| 6680 } // namespace content | 6681 } // namespace content |
| OLD | NEW |