OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/renderer_host/render_view_host.h" | 5 #include "content/browser/renderer_host/render_view_host.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnMsgRequestMove) | 665 IPC_MESSAGE_HANDLER(ViewHostMsg_RequestMove, OnMsgRequestMove) |
666 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartLoading, OnMsgDidStartLoading) | 666 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStartLoading, OnMsgDidStartLoading) |
667 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopLoading, OnMsgDidStopLoading) | 667 IPC_MESSAGE_HANDLER(ViewHostMsg_DidStopLoading, OnMsgDidStopLoading) |
668 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeLoadProgress, | 668 IPC_MESSAGE_HANDLER(ViewHostMsg_DidChangeLoadProgress, |
669 OnMsgDidChangeLoadProgress) | 669 OnMsgDidChangeLoadProgress) |
670 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentAvailableInMainFrame, | 670 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentAvailableInMainFrame, |
671 OnMsgDocumentAvailableInMainFrame) | 671 OnMsgDocumentAvailableInMainFrame) |
672 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentOnLoadCompletedInMainFrame, | 672 IPC_MESSAGE_HANDLER(ViewHostMsg_DocumentOnLoadCompletedInMainFrame, |
673 OnMsgDocumentOnLoadCompletedInMainFrame) | 673 OnMsgDocumentOnLoadCompletedInMainFrame) |
674 IPC_MESSAGE_HANDLER(ViewHostMsg_ContextMenu, OnMsgContextMenu) | 674 IPC_MESSAGE_HANDLER(ViewHostMsg_ContextMenu, OnMsgContextMenu) |
| 675 IPC_MESSAGE_HANDLER(ViewHostMsg_ToggleFullscreen, |
| 676 OnMsgToggleFullscreen) |
675 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenURL, OnMsgOpenURL) | 677 IPC_MESSAGE_HANDLER(ViewHostMsg_OpenURL, OnMsgOpenURL) |
676 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, | 678 IPC_MESSAGE_HANDLER(ViewHostMsg_DidContentsPreferredSizeChange, |
677 OnMsgDidContentsPreferredSizeChange) | 679 OnMsgDidContentsPreferredSizeChange) |
678 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, | 680 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunJavaScriptMessage, |
679 OnMsgRunJavaScriptMessage) | 681 OnMsgRunJavaScriptMessage) |
680 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, | 682 IPC_MESSAGE_HANDLER_DELAY_REPLY(ViewHostMsg_RunBeforeUnloadConfirm, |
681 OnMsgRunBeforeUnloadConfirm) | 683 OnMsgRunBeforeUnloadConfirm) |
682 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnMsgStartDragging) | 684 IPC_MESSAGE_HANDLER(DragHostMsg_StartDragging, OnMsgStartDragging) |
683 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) | 685 IPC_MESSAGE_HANDLER(DragHostMsg_UpdateDragCursor, OnUpdateDragCursor) |
684 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) | 686 IPC_MESSAGE_HANDLER(DragHostMsg_TargetDrop_ACK, OnTargetDropACK) |
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
954 // We don't validate |unfiltered_link_url| so that this field can be used | 956 // We don't validate |unfiltered_link_url| so that this field can be used |
955 // when users want to copy the original link URL. | 957 // when users want to copy the original link URL. |
956 FilterURL(policy, renderer_id, &validated_params.link_url); | 958 FilterURL(policy, renderer_id, &validated_params.link_url); |
957 FilterURL(policy, renderer_id, &validated_params.src_url); | 959 FilterURL(policy, renderer_id, &validated_params.src_url); |
958 FilterURL(policy, renderer_id, &validated_params.page_url); | 960 FilterURL(policy, renderer_id, &validated_params.page_url); |
959 FilterURL(policy, renderer_id, &validated_params.frame_url); | 961 FilterURL(policy, renderer_id, &validated_params.frame_url); |
960 | 962 |
961 view->ShowContextMenu(validated_params); | 963 view->ShowContextMenu(validated_params); |
962 } | 964 } |
963 | 965 |
| 966 void RenderViewHost::OnMsgToggleFullscreen(bool enter_fullscreen) { |
| 967 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 968 delegate_->ToggleFullscreenMode(enter_fullscreen); |
| 969 } |
| 970 |
964 void RenderViewHost::OnMsgOpenURL(const GURL& url, | 971 void RenderViewHost::OnMsgOpenURL(const GURL& url, |
965 const GURL& referrer, | 972 const GURL& referrer, |
966 WindowOpenDisposition disposition) { | 973 WindowOpenDisposition disposition) { |
967 GURL validated_url(url); | 974 GURL validated_url(url); |
968 FilterURL(ChildProcessSecurityPolicy::GetInstance(), | 975 FilterURL(ChildProcessSecurityPolicy::GetInstance(), |
969 process()->id(), &validated_url); | 976 process()->id(), &validated_url); |
970 | 977 |
971 delegate_->RequestOpenURL(validated_url, referrer, disposition); | 978 delegate_->RequestOpenURL(validated_url, referrer, disposition); |
972 } | 979 } |
973 | 980 |
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1313 if (view) { | 1320 if (view) { |
1314 view->ShowPopupMenu(params.bounds, | 1321 view->ShowPopupMenu(params.bounds, |
1315 params.item_height, | 1322 params.item_height, |
1316 params.item_font_size, | 1323 params.item_font_size, |
1317 params.selected_item, | 1324 params.selected_item, |
1318 params.popup_items, | 1325 params.popup_items, |
1319 params.right_aligned); | 1326 params.right_aligned); |
1320 } | 1327 } |
1321 } | 1328 } |
1322 #endif | 1329 #endif |
OLD | NEW |