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 <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
759 OnSerializeAsMHTMLResponse) | 759 OnSerializeAsMHTMLResponse) |
760 IPC_MESSAGE_HANDLER(FrameHostMsg_SelectionChanged, OnSelectionChanged) | 760 IPC_MESSAGE_HANDLER(FrameHostMsg_SelectionChanged, OnSelectionChanged) |
761 IPC_MESSAGE_HANDLER(FrameHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) | 761 IPC_MESSAGE_HANDLER(FrameHostMsg_FocusedNodeChanged, OnFocusedNodeChanged) |
762 IPC_MESSAGE_HANDLER(FrameHostMsg_SetHasReceivedUserGesture, | 762 IPC_MESSAGE_HANDLER(FrameHostMsg_SetHasReceivedUserGesture, |
763 OnSetHasReceivedUserGesture) | 763 OnSetHasReceivedUserGesture) |
764 #if defined(USE_EXTERNAL_POPUP_MENU) | 764 #if defined(USE_EXTERNAL_POPUP_MENU) |
765 IPC_MESSAGE_HANDLER(FrameHostMsg_ShowPopup, OnShowPopup) | 765 IPC_MESSAGE_HANDLER(FrameHostMsg_ShowPopup, OnShowPopup) |
766 IPC_MESSAGE_HANDLER(FrameHostMsg_HidePopup, OnHidePopup) | 766 IPC_MESSAGE_HANDLER(FrameHostMsg_HidePopup, OnHidePopup) |
767 #endif | 767 #endif |
768 IPC_MESSAGE_HANDLER(FrameHostMsg_ShowCreatedWindow, OnShowCreatedWindow) | 768 IPC_MESSAGE_HANDLER(FrameHostMsg_ShowCreatedWindow, OnShowCreatedWindow) |
| 769 IPC_MESSAGE_HANDLER(FrameHostMsg_RestorePageScaleFactorOnLoad, |
| 770 OnSetPageScaleFactorForSubframes) |
769 IPC_END_MESSAGE_MAP() | 771 IPC_END_MESSAGE_MAP() |
770 | 772 |
771 // No further actions here, since we may have been deleted. | 773 // No further actions here, since we may have been deleted. |
772 return handled; | 774 return handled; |
773 } | 775 } |
774 | 776 |
775 void RenderFrameHostImpl::OnAssociatedInterfaceRequest( | 777 void RenderFrameHostImpl::OnAssociatedInterfaceRequest( |
776 const std::string& interface_name, | 778 const std::string& interface_name, |
777 mojo::ScopedInterfaceEndpointHandle handle) { | 779 mojo::ScopedInterfaceEndpointHandle handle) { |
778 delegate_->OnAssociatedInterfaceRequest( | 780 delegate_->OnAssociatedInterfaceRequest( |
(...skipping 1453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2232 #endif | 2234 #endif |
2233 | 2235 |
2234 void RenderFrameHostImpl::OnShowCreatedWindow(int pending_widget_routing_id, | 2236 void RenderFrameHostImpl::OnShowCreatedWindow(int pending_widget_routing_id, |
2235 WindowOpenDisposition disposition, | 2237 WindowOpenDisposition disposition, |
2236 const gfx::Rect& initial_rect, | 2238 const gfx::Rect& initial_rect, |
2237 bool user_gesture) { | 2239 bool user_gesture) { |
2238 delegate_->ShowCreatedWindow(GetProcess()->GetID(), pending_widget_routing_id, | 2240 delegate_->ShowCreatedWindow(GetProcess()->GetID(), pending_widget_routing_id, |
2239 disposition, initial_rect, user_gesture); | 2241 disposition, initial_rect, user_gesture); |
2240 } | 2242 } |
2241 | 2243 |
| 2244 void RenderFrameHostImpl::OnSetPageScaleFactorForSubframes( |
| 2245 double page_scale_factor) { |
| 2246 // Only the main frame should be receiving this message. |
| 2247 if (!frame_tree_node_->IsMainFrame()) { |
| 2248 NOTREACHED(); |
| 2249 return; |
| 2250 } |
| 2251 |
| 2252 delegate_->SetPageScaleFactorForSubframes(page_scale_factor); |
| 2253 } |
| 2254 |
2242 void RenderFrameHostImpl::RegisterMojoInterfaces() { | 2255 void RenderFrameHostImpl::RegisterMojoInterfaces() { |
2243 device::GeolocationServiceContext* geolocation_service_context = | 2256 device::GeolocationServiceContext* geolocation_service_context = |
2244 delegate_ ? delegate_->GetGeolocationServiceContext() : NULL; | 2257 delegate_ ? delegate_->GetGeolocationServiceContext() : NULL; |
2245 if (geolocation_service_context) { | 2258 if (geolocation_service_context) { |
2246 // TODO(creis): Bind process ID here so that GeolocationServiceImpl | 2259 // TODO(creis): Bind process ID here so that GeolocationServiceImpl |
2247 // can perform permissions checks once site isolation is complete. | 2260 // can perform permissions checks once site isolation is complete. |
2248 // crbug.com/426384 | 2261 // crbug.com/426384 |
2249 // NOTE: At shutdown, there is no guaranteed ordering between destruction of | 2262 // NOTE: At shutdown, there is no guaranteed ordering between destruction of |
2250 // this object and destruction of any GeolocationServicesImpls created via | 2263 // this object and destruction of any GeolocationServicesImpls created via |
2251 // the below service registry, the reason being that the destruction of the | 2264 // the below service registry, the reason being that the destruction of the |
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3406 // There is no pending NavigationEntry in these cases, so pass 0 as the | 3419 // There is no pending NavigationEntry in these cases, so pass 0 as the |
3407 // pending_nav_entry_id. If the previous handle was a prematurely aborted | 3420 // pending_nav_entry_id. If the previous handle was a prematurely aborted |
3408 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. | 3421 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. |
3409 return NavigationHandleImpl::Create( | 3422 return NavigationHandleImpl::Create( |
3410 params.url, frame_tree_node_, is_renderer_initiated, | 3423 params.url, frame_tree_node_, is_renderer_initiated, |
3411 params.was_within_same_page, base::TimeTicks::Now(), | 3424 params.was_within_same_page, base::TimeTicks::Now(), |
3412 entry_id_for_data_nav, false); // started_from_context_menu | 3425 entry_id_for_data_nav, false); // started_from_context_menu |
3413 } | 3426 } |
3414 | 3427 |
3415 } // namespace content | 3428 } // namespace content |
OLD | NEW |