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/browser/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/containers/hash_tables.h" | 9 #include "base/containers/hash_tables.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding) | 324 IPC_MESSAGE_HANDLER(FrameHostMsg_UpdateEncoding, OnUpdateEncoding) |
325 IPC_MESSAGE_HANDLER(FrameHostMsg_BeginNavigation, | 325 IPC_MESSAGE_HANDLER(FrameHostMsg_BeginNavigation, |
326 OnBeginNavigation) | 326 OnBeginNavigation) |
327 IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse, | 327 IPC_MESSAGE_HANDLER(FrameHostMsg_TextSurroundingSelectionResponse, |
328 OnTextSurroundingSelectionResponse) | 328 OnTextSurroundingSelectionResponse) |
329 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) | 329 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_Events, OnAccessibilityEvents) |
330 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_LocationChanges, | 330 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_LocationChanges, |
331 OnAccessibilityLocationChanges) | 331 OnAccessibilityLocationChanges) |
332 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_FindInPageResult, | 332 IPC_MESSAGE_HANDLER(AccessibilityHostMsg_FindInPageResult, |
333 OnAccessibilityFindInPageResult) | 333 OnAccessibilityFindInPageResult) |
| 334 IPC_MESSAGE_HANDLER(FrameHostMsg_ToggleFullscreen, OnToggleFullscreen) |
334 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 335 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
335 IPC_MESSAGE_HANDLER(FrameHostMsg_ShowPopup, OnShowPopup) | 336 IPC_MESSAGE_HANDLER(FrameHostMsg_ShowPopup, OnShowPopup) |
336 IPC_MESSAGE_HANDLER(FrameHostMsg_HidePopup, OnHidePopup) | 337 IPC_MESSAGE_HANDLER(FrameHostMsg_HidePopup, OnHidePopup) |
337 #endif | 338 #endif |
338 IPC_END_MESSAGE_MAP() | 339 IPC_END_MESSAGE_MAP() |
339 | 340 |
340 // No further actions here, since we may have been deleted. | 341 // No further actions here, since we may have been deleted. |
341 return handled; | 342 return handled; |
342 } | 343 } |
343 | 344 |
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 BrowserAccessibilityManager* manager = | 1114 BrowserAccessibilityManager* manager = |
1114 GetOrCreateBrowserAccessibilityManager(); | 1115 GetOrCreateBrowserAccessibilityManager(); |
1115 if (manager) { | 1116 if (manager) { |
1116 manager->OnFindInPageResult( | 1117 manager->OnFindInPageResult( |
1117 params.request_id, params.match_index, params.start_id, | 1118 params.request_id, params.match_index, params.start_id, |
1118 params.start_offset, params.end_id, params.end_offset); | 1119 params.start_offset, params.end_id, params.end_offset); |
1119 } | 1120 } |
1120 } | 1121 } |
1121 } | 1122 } |
1122 | 1123 |
| 1124 void RenderFrameHostImpl::OnToggleFullscreen(bool enter_fullscreen) { |
| 1125 if (enter_fullscreen) |
| 1126 delegate_->EnterFullscreenMode(GetLastCommittedURL().GetOrigin()); |
| 1127 else |
| 1128 delegate_->ExitFullscreenMode(); |
| 1129 |
| 1130 // The previous call might change the fullscreen state. We need to make sure |
| 1131 // the renderer is aware of that, which is done via the resize message. |
| 1132 render_view_host_->WasResized(); |
| 1133 } |
| 1134 |
1123 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 1135 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
1124 void RenderFrameHostImpl::OnShowPopup( | 1136 void RenderFrameHostImpl::OnShowPopup( |
1125 const FrameHostMsg_ShowPopup_Params& params) { | 1137 const FrameHostMsg_ShowPopup_Params& params) { |
1126 RenderViewHostDelegateView* view = | 1138 RenderViewHostDelegateView* view = |
1127 render_view_host_->delegate_->GetDelegateView(); | 1139 render_view_host_->delegate_->GetDelegateView(); |
1128 if (view) { | 1140 if (view) { |
1129 view->ShowPopupMenu(this, | 1141 view->ShowPopupMenu(this, |
1130 params.bounds, | 1142 params.bounds, |
1131 params.item_height, | 1143 params.item_height, |
1132 params.item_font_size, | 1144 params.item_font_size, |
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1585 void RenderFrameHostImpl::DidUseGeolocationPermission() { | 1597 void RenderFrameHostImpl::DidUseGeolocationPermission() { |
1586 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); | 1598 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); |
1587 GetContentClient()->browser()->RegisterPermissionUsage( | 1599 GetContentClient()->browser()->RegisterPermissionUsage( |
1588 PERMISSION_GEOLOCATION, | 1600 PERMISSION_GEOLOCATION, |
1589 delegate_->GetAsWebContents(), | 1601 delegate_->GetAsWebContents(), |
1590 GetLastCommittedURL().GetOrigin(), | 1602 GetLastCommittedURL().GetOrigin(), |
1591 top_frame->GetLastCommittedURL().GetOrigin()); | 1603 top_frame->GetLastCommittedURL().GetOrigin()); |
1592 } | 1604 } |
1593 | 1605 |
1594 } // namespace content | 1606 } // namespace content |
OLD | NEW |