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 if (!frame_) | |
nasko
2016/03/24 13:55:23
nit: frame_ should never be invalid except for ver
clamy
2016/03/24 14:01:36
Switched to a DCHECK.
| |
5099 return; | |
5100 DCHECK(!frame_->parent()); | |
5101 frame_->enableViewSourceMode(true); | |
5102 } | |
5103 | |
5096 #if defined(OS_ANDROID) | 5104 #if defined(OS_ANDROID) |
5097 void RenderFrameImpl::OnActivateNearestFindResult(int request_id, | 5105 void RenderFrameImpl::OnActivateNearestFindResult(int request_id, |
5098 float x, | 5106 float x, |
5099 float y) { | 5107 float y) { |
5100 WebRect selection_rect; | 5108 WebRect selection_rect; |
5101 int ordinal = | 5109 int ordinal = |
5102 frame_->selectNearestFindMatch(WebFloatPoint(x, y), &selection_rect); | 5110 frame_->selectNearestFindMatch(WebFloatPoint(x, y), &selection_rect); |
5103 if (ordinal == -1) { | 5111 if (ordinal == -1) { |
5104 // Something went wrong, so send a no-op reply (force the frame to report | 5112 // 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 | 5113 // 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, | 6014 int match_count, |
6007 int ordinal, | 6015 int ordinal, |
6008 const WebRect& selection_rect, | 6016 const WebRect& selection_rect, |
6009 bool final_status_update) { | 6017 bool final_status_update) { |
6010 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, | 6018 Send(new FrameHostMsg_Find_Reply(routing_id_, request_id, match_count, |
6011 selection_rect, ordinal, | 6019 selection_rect, ordinal, |
6012 final_status_update)); | 6020 final_status_update)); |
6013 } | 6021 } |
6014 | 6022 |
6015 } // namespace content | 6023 } // namespace content |
OLD | NEW |