| 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 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1125 BrowserAccessibilityManager* manager = | 1126 BrowserAccessibilityManager* manager = |
| 1126 GetOrCreateBrowserAccessibilityManager(); | 1127 GetOrCreateBrowserAccessibilityManager(); |
| 1127 if (manager) { | 1128 if (manager) { |
| 1128 manager->OnFindInPageResult( | 1129 manager->OnFindInPageResult( |
| 1129 params.request_id, params.match_index, params.start_id, | 1130 params.request_id, params.match_index, params.start_id, |
| 1130 params.start_offset, params.end_id, params.end_offset); | 1131 params.start_offset, params.end_id, params.end_offset); |
| 1131 } | 1132 } |
| 1132 } | 1133 } |
| 1133 } | 1134 } |
| 1134 | 1135 |
| 1136 void RenderFrameHostImpl::OnToggleFullscreen(bool enter_fullscreen) { |
| 1137 if (enter_fullscreen) |
| 1138 delegate_->EnterFullscreenMode(GetLastCommittedURL().GetOrigin()); |
| 1139 else |
| 1140 delegate_->ExitFullscreenMode(); |
| 1141 |
| 1142 // The previous call might change the fullscreen state. We need to make sure |
| 1143 // the renderer is aware of that, which is done via the resize message. |
| 1144 render_view_host_->WasResized(); |
| 1145 } |
| 1146 |
| 1135 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 1147 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 1136 void RenderFrameHostImpl::OnShowPopup( | 1148 void RenderFrameHostImpl::OnShowPopup( |
| 1137 const FrameHostMsg_ShowPopup_Params& params) { | 1149 const FrameHostMsg_ShowPopup_Params& params) { |
| 1138 RenderViewHostDelegateView* view = | 1150 RenderViewHostDelegateView* view = |
| 1139 render_view_host_->delegate_->GetDelegateView(); | 1151 render_view_host_->delegate_->GetDelegateView(); |
| 1140 if (view) { | 1152 if (view) { |
| 1141 view->ShowPopupMenu(this, | 1153 view->ShowPopupMenu(this, |
| 1142 params.bounds, | 1154 params.bounds, |
| 1143 params.item_height, | 1155 params.item_height, |
| 1144 params.item_font_size, | 1156 params.item_font_size, |
| (...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1601 void RenderFrameHostImpl::DidUseGeolocationPermission() { | 1613 void RenderFrameHostImpl::DidUseGeolocationPermission() { |
| 1602 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); | 1614 RenderFrameHost* top_frame = frame_tree_node()->frame_tree()->GetMainFrame(); |
| 1603 GetContentClient()->browser()->RegisterPermissionUsage( | 1615 GetContentClient()->browser()->RegisterPermissionUsage( |
| 1604 PERMISSION_GEOLOCATION, | 1616 PERMISSION_GEOLOCATION, |
| 1605 delegate_->GetAsWebContents(), | 1617 delegate_->GetAsWebContents(), |
| 1606 GetLastCommittedURL().GetOrigin(), | 1618 GetLastCommittedURL().GetOrigin(), |
| 1607 top_frame->GetLastCommittedURL().GetOrigin()); | 1619 top_frame->GetLastCommittedURL().GetOrigin()); |
| 1608 } | 1620 } |
| 1609 | 1621 |
| 1610 } // namespace content | 1622 } // namespace content |
| OLD | NEW |