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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 89 #include "content/renderer/context_menu_params_builder.h" | 89 #include "content/renderer/context_menu_params_builder.h" |
| 90 #include "content/renderer/devtools/devtools_agent.h" | 90 #include "content/renderer/devtools/devtools_agent.h" |
| 91 #include "content/renderer/dom_automation_controller.h" | 91 #include "content/renderer/dom_automation_controller.h" |
| 92 #include "content/renderer/effective_connection_type_helper.h" | 92 #include "content/renderer/effective_connection_type_helper.h" |
| 93 #include "content/renderer/external_popup_menu.h" | 93 #include "content/renderer/external_popup_menu.h" |
| 94 #include "content/renderer/gpu/gpu_benchmarking_extension.h" | 94 #include "content/renderer/gpu/gpu_benchmarking_extension.h" |
| 95 #include "content/renderer/history_controller.h" | 95 #include "content/renderer/history_controller.h" |
| 96 #include "content/renderer/history_serialization.h" | 96 #include "content/renderer/history_serialization.h" |
| 97 #include "content/renderer/image_downloader/image_downloader_impl.h" | 97 #include "content/renderer/image_downloader/image_downloader_impl.h" |
| 98 #include "content/renderer/ime_event_guard.h" | 98 #include "content/renderer/ime_event_guard.h" |
| 99 #include "content/renderer/input/input_handler_manager.h" | |
| 99 #include "content/renderer/internal_document_state_data.h" | 100 #include "content/renderer/internal_document_state_data.h" |
| 100 #include "content/renderer/manifest/manifest_manager.h" | 101 #include "content/renderer/manifest/manifest_manager.h" |
| 101 #include "content/renderer/media/audio_device_factory.h" | 102 #include "content/renderer/media/audio_device_factory.h" |
| 102 #include "content/renderer/media/media_permission_dispatcher.h" | 103 #include "content/renderer/media/media_permission_dispatcher.h" |
| 103 #include "content/renderer/media/media_stream_dispatcher.h" | 104 #include "content/renderer/media/media_stream_dispatcher.h" |
| 104 #include "content/renderer/media/media_stream_renderer_factory_impl.h" | 105 #include "content/renderer/media/media_stream_renderer_factory_impl.h" |
| 105 #include "content/renderer/media/midi_dispatcher.h" | 106 #include "content/renderer/media/midi_dispatcher.h" |
| 106 #include "content/renderer/media/render_media_log.h" | 107 #include "content/renderer/media/render_media_log.h" |
| 107 #include "content/renderer/media/renderer_webmediaplayer_delegate.h" | 108 #include "content/renderer/media/renderer_webmediaplayer_delegate.h" |
| 108 #include "content/renderer/media/user_media_client_impl.h" | 109 #include "content/renderer/media/user_media_client_impl.h" |
| (...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1214 // DevToolsAgent is a RenderFrameObserver, and will destruct itself | 1215 // DevToolsAgent is a RenderFrameObserver, and will destruct itself |
| 1215 // when |this| is deleted. | 1216 // when |this| is deleted. |
| 1216 devtools_agent_ = new DevToolsAgent(this); | 1217 devtools_agent_ = new DevToolsAgent(this); |
| 1217 } | 1218 } |
| 1218 | 1219 |
| 1219 RegisterMojoServices(); | 1220 RegisterMojoServices(); |
| 1220 | 1221 |
| 1221 // We delay calling this until we have the WebFrame so that any observer or | 1222 // We delay calling this until we have the WebFrame so that any observer or |
| 1222 // embedder can call GetWebFrame on any RenderFrame. | 1223 // embedder can call GetWebFrame on any RenderFrame. |
| 1223 GetContentClient()->renderer()->RenderFrameCreated(this); | 1224 GetContentClient()->renderer()->RenderFrameCreated(this); |
| 1225 | |
| 1226 // TODO(changwan): apply this logic to RenderWidget once we add input handler | |
|
no sievers
2016/06/01 22:14:47
nit: i'd remove this TODO here since IIUC you inte
Changwan Ryu
2016/06/03 06:48:29
Removed.
| |
| 1227 // in RenderWidget, too. | |
| 1228 if (render_view_ && render_view_->HasAddedInputHandler()) { | |
|
no sievers
2016/06/01 22:14:47
This looks fragile. Do you expect HasAddedInputHan
Changwan Ryu
2016/06/02 10:49:06
Two hidden assumptions here:
1) initializeLayerTre
Changwan Ryu
2016/06/03 06:48:29
Removed render_view check and changed to DCHECK().
| |
| 1229 RenderThreadImpl* render_thread = RenderThreadImpl::current(); | |
| 1230 // render_thread may be NULL in tests. | |
| 1231 InputHandlerManager* input_handler_manager = | |
| 1232 render_thread ? render_thread->input_handler_manager() : nullptr; | |
| 1233 if (input_handler_manager) | |
| 1234 input_handler_manager->RegisterRoutingID(GetRoutingID()); | |
|
no sievers
2016/06/01 22:14:47
How does it get unregistered?
Changwan Ryu
2016/06/03 06:48:29
Now it's unregistered in ~RenderFrameImpl().
| |
| 1235 } | |
| 1224 } | 1236 } |
| 1225 | 1237 |
| 1226 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { | 1238 void RenderFrameImpl::InitializeBlameContext(RenderFrameImpl* parent_frame) { |
| 1227 DCHECK(!blame_context_); | 1239 DCHECK(!blame_context_); |
| 1228 blame_context_ = new FrameBlameContext(this, parent_frame); | 1240 blame_context_ = new FrameBlameContext(this, parent_frame); |
| 1229 blame_context_->Initialize(); | 1241 blame_context_->Initialize(); |
| 1230 } | 1242 } |
| 1231 | 1243 |
| 1232 void RenderFrameImpl::OnGotZoomLevel(const GURL& url, double zoom_level) { | 1244 void RenderFrameImpl::OnGotZoomLevel(const GURL& url, double zoom_level) { |
| 1233 // TODO(wjmaclean): We should see if this restriction is really necessary, | 1245 // TODO(wjmaclean): We should see if this restriction is really necessary, |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1505 OnAdjustSelectionByCharacterOffset) | 1517 OnAdjustSelectionByCharacterOffset) |
| 1506 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect) | 1518 IPC_MESSAGE_HANDLER(InputMsg_Unselect, OnUnselect) |
| 1507 IPC_MESSAGE_HANDLER(InputMsg_MoveRangeSelectionExtent, | 1519 IPC_MESSAGE_HANDLER(InputMsg_MoveRangeSelectionExtent, |
| 1508 OnMoveRangeSelectionExtent) | 1520 OnMoveRangeSelectionExtent) |
| 1509 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace) | 1521 IPC_MESSAGE_HANDLER(InputMsg_Replace, OnReplace) |
| 1510 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling) | 1522 IPC_MESSAGE_HANDLER(InputMsg_ReplaceMisspelling, OnReplaceMisspelling) |
| 1511 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete, | 1523 IPC_MESSAGE_HANDLER(InputMsg_ExtendSelectionAndDelete, |
| 1512 OnExtendSelectionAndDelete) | 1524 OnExtendSelectionAndDelete) |
| 1513 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText, | 1525 IPC_MESSAGE_HANDLER(InputMsg_SetCompositionFromExistingText, |
| 1514 OnSetCompositionFromExistingText) | 1526 OnSetCompositionFromExistingText) |
| 1527 IPC_MESSAGE_HANDLER(InputMsg_SetEditableSelectionOffsets, | |
| 1528 OnSetEditableSelectionOffsets) | |
| 1515 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand, | 1529 IPC_MESSAGE_HANDLER(InputMsg_ExecuteNoValueEditCommand, |
| 1516 OnExecuteNoValueEditCommand) | 1530 OnExecuteNoValueEditCommand) |
| 1517 IPC_MESSAGE_HANDLER(FrameMsg_CSSInsertRequest, OnCSSInsertRequest) | 1531 IPC_MESSAGE_HANDLER(FrameMsg_CSSInsertRequest, OnCSSInsertRequest) |
| 1518 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole) | 1532 IPC_MESSAGE_HANDLER(FrameMsg_AddMessageToConsole, OnAddMessageToConsole) |
| 1519 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest, | 1533 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequest, |
| 1520 OnJavaScriptExecuteRequest) | 1534 OnJavaScriptExecuteRequest) |
| 1521 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests, | 1535 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests, |
| 1522 OnJavaScriptExecuteRequestForTests) | 1536 OnJavaScriptExecuteRequestForTests) |
| 1523 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestInIsolatedWorld, | 1537 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestInIsolatedWorld, |
| 1524 OnJavaScriptExecuteRequestInIsolatedWorld) | 1538 OnJavaScriptExecuteRequestInIsolatedWorld) |
| 1525 IPC_MESSAGE_HANDLER(FrameMsg_VisualStateRequest, | 1539 IPC_MESSAGE_HANDLER(FrameMsg_VisualStateRequest, |
| 1526 OnVisualStateRequest) | 1540 OnVisualStateRequest) |
| 1527 IPC_MESSAGE_HANDLER(FrameMsg_SetEditableSelectionOffsets, | |
| 1528 OnSetEditableSelectionOffsets) | |
| 1529 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) | 1541 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) |
| 1530 IPC_MESSAGE_HANDLER(FrameMsg_ReloadLoFiImages, OnReloadLoFiImages) | 1542 IPC_MESSAGE_HANDLER(FrameMsg_ReloadLoFiImages, OnReloadLoFiImages) |
| 1531 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, | 1543 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, |
| 1532 OnTextSurroundingSelectionRequest) | 1544 OnTextSurroundingSelectionRequest) |
| 1533 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, | 1545 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, |
| 1534 OnSetAccessibilityMode) | 1546 OnSetAccessibilityMode) |
| 1535 IPC_MESSAGE_HANDLER(AccessibilityMsg_SnapshotTree, | 1547 IPC_MESSAGE_HANDLER(AccessibilityMsg_SnapshotTree, |
| 1536 OnSnapshotAccessibilityTree) | 1548 OnSnapshotAccessibilityTree) |
| 1537 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) | 1549 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) |
| 1538 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) | 1550 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) |
| (...skipping 4677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6216 // event target. Potentially a Pepper plugin will receive the event. | 6228 // event target. Potentially a Pepper plugin will receive the event. |
| 6217 // In order to tell whether a plugin gets the last mouse event and which it | 6229 // In order to tell whether a plugin gets the last mouse event and which it |
| 6218 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6230 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6219 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6231 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6220 // |pepper_last_mouse_event_target_|. | 6232 // |pepper_last_mouse_event_target_|. |
| 6221 pepper_last_mouse_event_target_ = nullptr; | 6233 pepper_last_mouse_event_target_ = nullptr; |
| 6222 #endif | 6234 #endif |
| 6223 } | 6235 } |
| 6224 | 6236 |
| 6225 } // namespace content | 6237 } // namespace content |
| OLD | NEW |