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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 67 #include "content/common/swapped_out_messages.h" | 67 #include "content/common/swapped_out_messages.h" |
| 68 #include "content/common/view_messages.h" | 68 #include "content/common/view_messages.h" |
| 69 #include "content/public/common/bindings_policy.h" | 69 #include "content/public/common/bindings_policy.h" |
| 70 #include "content/public/common/browser_side_navigation_policy.h" | 70 #include "content/public/common/browser_side_navigation_policy.h" |
| 71 #include "content/public/common/content_constants.h" | 71 #include "content/public/common/content_constants.h" |
| 72 #include "content/public/common/content_features.h" | 72 #include "content/public/common/content_features.h" |
| 73 #include "content/public/common/content_switches.h" | 73 #include "content/public/common/content_switches.h" |
| 74 #include "content/public/common/context_menu_params.h" | 74 #include "content/public/common/context_menu_params.h" |
| 75 #include "content/public/common/file_chooser_file_info.h" | 75 #include "content/public/common/file_chooser_file_info.h" |
| 76 #include "content/public/common/file_chooser_params.h" | 76 #include "content/public/common/file_chooser_params.h" |
| 77 #include "content/public/common/form_field_data.h" | |
| 77 #include "content/public/common/isolated_world_ids.h" | 78 #include "content/public/common/isolated_world_ids.h" |
| 78 #include "content/public/common/page_state.h" | 79 #include "content/public/common/page_state.h" |
| 79 #include "content/public/common/resource_response.h" | 80 #include "content/public/common/resource_response.h" |
| 80 #include "content/public/common/service_manager_connection.h" | 81 #include "content/public/common/service_manager_connection.h" |
| 81 #include "content/public/common/url_constants.h" | 82 #include "content/public/common/url_constants.h" |
| 82 #include "content/public/common/url_utils.h" | 83 #include "content/public/common/url_utils.h" |
| 83 #include "content/public/renderer/browser_plugin_delegate.h" | 84 #include "content/public/renderer/browser_plugin_delegate.h" |
| 84 #include "content/public/renderer/content_renderer_client.h" | 85 #include "content/public/renderer/content_renderer_client.h" |
| 85 #include "content/public/renderer/context_menu_client.h" | 86 #include "content/public/renderer/context_menu_client.h" |
| 86 #include "content/public/renderer/document_state.h" | 87 #include "content/public/renderer/document_state.h" |
| (...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1564 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests, | 1565 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestForTests, |
| 1565 OnJavaScriptExecuteRequestForTests) | 1566 OnJavaScriptExecuteRequestForTests) |
| 1566 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestInIsolatedWorld, | 1567 IPC_MESSAGE_HANDLER(FrameMsg_JavaScriptExecuteRequestInIsolatedWorld, |
| 1567 OnJavaScriptExecuteRequestInIsolatedWorld) | 1568 OnJavaScriptExecuteRequestInIsolatedWorld) |
| 1568 IPC_MESSAGE_HANDLER(FrameMsg_VisualStateRequest, | 1569 IPC_MESSAGE_HANDLER(FrameMsg_VisualStateRequest, |
| 1569 OnVisualStateRequest) | 1570 OnVisualStateRequest) |
| 1570 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) | 1571 IPC_MESSAGE_HANDLER(FrameMsg_Reload, OnReload) |
| 1571 IPC_MESSAGE_HANDLER(FrameMsg_ReloadLoFiImages, OnReloadLoFiImages) | 1572 IPC_MESSAGE_HANDLER(FrameMsg_ReloadLoFiImages, OnReloadLoFiImages) |
| 1572 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, | 1573 IPC_MESSAGE_HANDLER(FrameMsg_TextSurroundingSelectionRequest, |
| 1573 OnTextSurroundingSelectionRequest) | 1574 OnTextSurroundingSelectionRequest) |
| 1575 IPC_MESSAGE_HANDLER(FrameMsg_FocusedFormFieldDataRequest, | |
| 1576 OnFocusedFormFieldDataRequest) | |
| 1574 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, | 1577 IPC_MESSAGE_HANDLER(FrameMsg_SetAccessibilityMode, |
| 1575 OnSetAccessibilityMode) | 1578 OnSetAccessibilityMode) |
| 1576 IPC_MESSAGE_HANDLER(AccessibilityMsg_SnapshotTree, | 1579 IPC_MESSAGE_HANDLER(AccessibilityMsg_SnapshotTree, |
| 1577 OnSnapshotAccessibilityTree) | 1580 OnSnapshotAccessibilityTree) |
| 1578 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) | 1581 IPC_MESSAGE_HANDLER(FrameMsg_UpdateOpener, OnUpdateOpener) |
| 1579 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) | 1582 IPC_MESSAGE_HANDLER(FrameMsg_CommitNavigation, OnCommitNavigation) |
| 1580 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) | 1583 IPC_MESSAGE_HANDLER(FrameMsg_DidUpdateSandboxFlags, OnDidUpdateSandboxFlags) |
| 1581 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, | 1584 IPC_MESSAGE_HANDLER(FrameMsg_SetFrameOwnerProperties, |
| 1582 OnSetFrameOwnerProperties) | 1585 OnSetFrameOwnerProperties) |
| 1583 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus) | 1586 IPC_MESSAGE_HANDLER(FrameMsg_AdvanceFocus, OnAdvanceFocus) |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2292 return; | 2295 return; |
| 2293 } | 2296 } |
| 2294 | 2297 |
| 2295 Send(new FrameHostMsg_TextSurroundingSelectionResponse( | 2298 Send(new FrameHostMsg_TextSurroundingSelectionResponse( |
| 2296 routing_id_, | 2299 routing_id_, |
| 2297 surroundingText.textContent(), | 2300 surroundingText.textContent(), |
| 2298 surroundingText.startOffsetInTextContent(), | 2301 surroundingText.startOffsetInTextContent(), |
| 2299 surroundingText.endOffsetInTextContent())); | 2302 surroundingText.endOffsetInTextContent())); |
| 2300 } | 2303 } |
| 2301 | 2304 |
| 2305 void RenderFrameImpl::OnFocusedFormFieldDataRequest(int request_id) { | |
| 2306 DCHECK(frame_); | |
| 2307 WebElement element = frame_->document().focusedElement(); | |
|
EhsanK
2016/11/08 15:52:45
I noticed that the assumption here is |frame_| is
shaktisahu
2016/11/11 01:15:03
Ack! Added check for if |frame_| is still focused.
| |
| 2308 if (element.isNull()) | |
| 2309 return; | |
| 2310 | |
| 2311 DCHECK(GetRenderWidget()->GetWebWidget()); | |
| 2312 blink::WebTextInputInfo info = | |
| 2313 GetRenderWidget()->GetWebWidget()->textInputInfo(); | |
| 2314 FormFieldData field; | |
| 2315 field.text = info.value.utf8(); | |
| 2316 field.placeholder = element.getAttribute("placeholder").utf8(); | |
| 2317 field.text_input_type = GetRenderWidget()->GetTextInputType(); | |
| 2318 | |
| 2319 Send(new FrameHostMsg_FocusedFormFieldDataResponse(routing_id_, request_id, | |
| 2320 field)); | |
| 2321 } | |
| 2322 | |
| 2302 bool RenderFrameImpl::RunJavaScriptMessage(JavaScriptMessageType type, | 2323 bool RenderFrameImpl::RunJavaScriptMessage(JavaScriptMessageType type, |
| 2303 const base::string16& message, | 2324 const base::string16& message, |
| 2304 const base::string16& default_value, | 2325 const base::string16& default_value, |
| 2305 const GURL& frame_url, | 2326 const GURL& frame_url, |
| 2306 base::string16* result) { | 2327 base::string16* result) { |
| 2307 // Don't allow further dialogs if we are waiting to swap out, since the | 2328 // Don't allow further dialogs if we are waiting to swap out, since the |
| 2308 // ScopedPageLoadDeferrer in our stack prevents it. | 2329 // ScopedPageLoadDeferrer in our stack prevents it. |
| 2309 if (suppress_further_dialogs_) | 2330 if (suppress_further_dialogs_) |
| 2310 return false; | 2331 return false; |
| 2311 | 2332 |
| (...skipping 4257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 6569 // event target. Potentially a Pepper plugin will receive the event. | 6590 // event target. Potentially a Pepper plugin will receive the event. |
| 6570 // In order to tell whether a plugin gets the last mouse event and which it | 6591 // In order to tell whether a plugin gets the last mouse event and which it |
| 6571 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets | 6592 // is, we set |pepper_last_mouse_event_target_| to null here. If a plugin gets |
| 6572 // the event, it will notify us via DidReceiveMouseEvent() and set itself as | 6593 // the event, it will notify us via DidReceiveMouseEvent() and set itself as |
| 6573 // |pepper_last_mouse_event_target_|. | 6594 // |pepper_last_mouse_event_target_|. |
| 6574 pepper_last_mouse_event_target_ = nullptr; | 6595 pepper_last_mouse_event_target_ = nullptr; |
| 6575 #endif | 6596 #endif |
| 6576 } | 6597 } |
| 6577 | 6598 |
| 6578 } // namespace content | 6599 } // namespace content |
| OLD | NEW |