| 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 1404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1415 OnTextTrackSettingsChanged) | 1415 OnTextTrackSettingsChanged) |
| 1416 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent) | 1416 IPC_MESSAGE_HANDLER(FrameMsg_PostMessageEvent, OnPostMessageEvent) |
| 1417 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation) | 1417 IPC_MESSAGE_HANDLER(FrameMsg_FailedNavigation, OnFailedNavigation) |
| 1418 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks, | 1418 IPC_MESSAGE_HANDLER(FrameMsg_GetSavableResourceLinks, |
| 1419 OnGetSavableResourceLinks) | 1419 OnGetSavableResourceLinks) |
| 1420 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks, | 1420 IPC_MESSAGE_HANDLER(FrameMsg_GetSerializedHtmlWithLocalLinks, |
| 1421 OnGetSerializedHtmlWithLocalLinks) | 1421 OnGetSerializedHtmlWithLocalLinks) |
| 1422 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML) | 1422 IPC_MESSAGE_HANDLER(FrameMsg_SerializeAsMHTML, OnSerializeAsMHTML) |
| 1423 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) | 1423 IPC_MESSAGE_HANDLER(FrameMsg_Find, OnFind) |
| 1424 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) | 1424 IPC_MESSAGE_HANDLER(FrameMsg_StopFinding, OnStopFinding) |
| 1425 IPC_MESSAGE_HANDLER(FrameMsg_EnableViewSourceMode, OnEnableViewSourceMode) |
| 1425 #if defined(OS_ANDROID) | 1426 #if defined(OS_ANDROID) |
| 1426 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, | 1427 IPC_MESSAGE_HANDLER(InputMsg_ActivateNearestFindResult, |
| 1427 OnActivateNearestFindResult) | 1428 OnActivateNearestFindResult) |
| 1428 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects) | 1429 IPC_MESSAGE_HANDLER(FrameMsg_FindMatchRects, OnFindMatchRects) |
| 1429 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) | 1430 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItems, OnSelectPopupMenuItems) |
| 1430 #elif defined(OS_MACOSX) | 1431 #elif defined(OS_MACOSX) |
| 1431 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) | 1432 IPC_MESSAGE_HANDLER(FrameMsg_SelectPopupMenuItem, OnSelectPopupMenuItem) |
| 1432 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) | 1433 IPC_MESSAGE_HANDLER(InputMsg_CopyToFindPboard, OnCopyToFindPboard) |
| 1433 #endif | 1434 #endif |
| 1434 IPC_END_MESSAGE_MAP() | 1435 IPC_END_MESSAGE_MAP() |
| (...skipping 3651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5086 WebDocument doc = focused_frame->document(); | 5087 WebDocument doc = focused_frame->document(); |
| 5087 if (!doc.isNull()) { | 5088 if (!doc.isNull()) { |
| 5088 WebElement element = doc.focusedElement(); | 5089 WebElement element = doc.focusedElement(); |
| 5089 if (!element.isNull()) | 5090 if (!element.isNull()) |
| 5090 element.simulateClick(); | 5091 element.simulateClick(); |
| 5091 } | 5092 } |
| 5092 } | 5093 } |
| 5093 } | 5094 } |
| 5094 } | 5095 } |
| 5095 | 5096 |
| 5097 void RenderFrameImpl::OnEnableViewSourceMode() { |
| 5098 DCHECK(frame_); |
| 5099 DCHECK(!frame_->parent()); |
| 5100 frame_->enableViewSourceMode(true); |
| 5101 } |
| 5102 |
| 5096 #if defined(OS_ANDROID) | 5103 #if defined(OS_ANDROID) |
| 5097 void RenderFrameImpl::OnActivateNearestFindResult(int request_id, | 5104 void RenderFrameImpl::OnActivateNearestFindResult(int request_id, |
| 5098 float x, | 5105 float x, |
| 5099 float y) { | 5106 float y) { |
| 5100 WebRect selection_rect; | 5107 WebRect selection_rect; |
| 5101 int ordinal = | 5108 int ordinal = |
| 5102 frame_->selectNearestFindMatch(WebFloatPoint(x, y), &selection_rect); | 5109 frame_->selectNearestFindMatch(WebFloatPoint(x, y), &selection_rect); |
| 5103 if (ordinal == -1) { | 5110 if (ordinal == -1) { |
| 5104 // Something went wrong, so send a no-op reply (force the frame to report | 5111 // Something went wrong, so send a no-op reply (force the frame to report |
| 5105 // the current match count) in case the host is waiting for a response due | 5112 // the current match count) in case the host is waiting for a response due |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6006 int match_count, | 6013 int match_count, |
| 6007 int ordinal, | 6014 int ordinal, |
| 6008 const WebRect& selection_rect, | 6015 const WebRect& selection_rect, |
| 6009 bool final_status_update) { | 6016 bool final_status_update) { |
| 6010 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, | 6017 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, |
| 6011 selection_rect, ordinal, | 6018 selection_rect, ordinal, |
| 6012 final_status_update)); | 6019 final_status_update)); |
| 6013 } | 6020 } |
| 6014 | 6021 |
| 6015 } // namespace content | 6022 } // namespace content |
| OLD | NEW |