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 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" | 200 #include "third_party/WebKit/public/web/WebScopedUserGesture.h" |
201 #include "third_party/WebKit/public/web/WebScriptSource.h" | 201 #include "third_party/WebKit/public/web/WebScriptSource.h" |
202 #include "third_party/WebKit/public/web/WebSearchableFormData.h" | 202 #include "third_party/WebKit/public/web/WebSearchableFormData.h" |
203 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 203 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
204 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" | 204 #include "third_party/WebKit/public/web/WebSerializedScriptValue.h" |
205 #include "third_party/WebKit/public/web/WebSettings.h" | 205 #include "third_party/WebKit/public/web/WebSettings.h" |
206 #include "third_party/WebKit/public/web/WebSurroundingText.h" | 206 #include "third_party/WebKit/public/web/WebSurroundingText.h" |
207 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" | 207 #include "third_party/WebKit/public/web/WebUserGestureIndicator.h" |
208 #include "third_party/WebKit/public/web/WebView.h" | 208 #include "third_party/WebKit/public/web/WebView.h" |
209 #include "third_party/WebKit/public/web/WebWidget.h" | 209 #include "third_party/WebKit/public/web/WebWidget.h" |
| 210 #include "ui/events/base_event_utils.h" |
210 #include "url/origin.h" | 211 #include "url/origin.h" |
211 #include "url/url_constants.h" | 212 #include "url/url_constants.h" |
212 #include "url/url_util.h" | 213 #include "url/url_util.h" |
213 | 214 |
214 #if BUILDFLAG(ENABLE_PLUGINS) | 215 #if BUILDFLAG(ENABLE_PLUGINS) |
215 #include "content/renderer/pepper/pepper_browser_connection.h" | 216 #include "content/renderer/pepper/pepper_browser_connection.h" |
216 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 217 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
217 #include "content/renderer/pepper/pepper_plugin_registry.h" | 218 #include "content/renderer/pepper/pepper_plugin_registry.h" |
218 #include "content/renderer/pepper/pepper_webplugin_impl.h" | 219 #include "content/renderer/pepper/pepper_webplugin_impl.h" |
219 #include "content/renderer/pepper/plugin_module.h" | 220 #include "content/renderer/pepper/plugin_module.h" |
(...skipping 6236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6456 return; | 6457 return; |
6457 | 6458 |
6458 if (!IsPepperAcceptingCompositionEvents()) { | 6459 if (!IsPepperAcceptingCompositionEvents()) { |
6459 // For pepper plugins unable to handle IME events, send the plugin a | 6460 // For pepper plugins unable to handle IME events, send the plugin a |
6460 // sequence of characters instead. | 6461 // sequence of characters instead. |
6461 base::i18n::UTF16CharIterator iterator(&text); | 6462 base::i18n::UTF16CharIterator iterator(&text); |
6462 int32_t i = 0; | 6463 int32_t i = 0; |
6463 while (iterator.Advance()) { | 6464 while (iterator.Advance()) { |
6464 blink::WebKeyboardEvent char_event; | 6465 blink::WebKeyboardEvent char_event; |
6465 char_event.type = blink::WebInputEvent::Char; | 6466 char_event.type = blink::WebInputEvent::Char; |
6466 char_event.timeStampSeconds = base::Time::Now().ToDoubleT(); | 6467 char_event.timeStampSeconds = |
| 6468 ui::EventTimeStampToSeconds(ui::EventTimeForNow()); |
6467 char_event.modifiers = 0; | 6469 char_event.modifiers = 0; |
6468 char_event.windowsKeyCode = text[i]; | 6470 char_event.windowsKeyCode = text[i]; |
6469 char_event.nativeKeyCode = text[i]; | 6471 char_event.nativeKeyCode = text[i]; |
6470 | 6472 |
6471 const int32_t char_start = i; | 6473 const int32_t char_start = i; |
6472 for (; i < iterator.array_pos(); ++i) { | 6474 for (; i < iterator.array_pos(); ++i) { |
6473 char_event.text[i - char_start] = text[i]; | 6475 char_event.text[i - char_start] = text[i]; |
6474 char_event.unmodifiedText[i - char_start] = text[i]; | 6476 char_event.unmodifiedText[i - char_start] = text[i]; |
6475 } | 6477 } |
6476 | 6478 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6671 // event target. Potentially a Pepper plugin will receive the event. | 6673 // 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 | 6674 // 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 | 6675 // 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 | 6676 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
6675 // |pepper_last_mouse_event_target_|. | 6677 // |pepper_last_mouse_event_target_|. |
6676 pepper_last_mouse_event_target_ = nullptr; | 6678 pepper_last_mouse_event_target_ = nullptr; |
6677 #endif | 6679 #endif |
6678 } | 6680 } |
6679 | 6681 |
6680 } // namespace content | 6682 } // namespace content |
OLD | NEW |