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/interstitial_page_impl.h" | 5 #include "content/browser/frame_host/interstitial_page_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 DCHECK(rvh->GetProcess()->GetID() == original_child_id_ && | 341 DCHECK(rvh->GetProcess()->GetID() == original_child_id_ && |
342 rvh->GetRoutingID() == original_rvh_id_); | 342 rvh->GetRoutingID() == original_rvh_id_); |
343 TakeActionOnResourceDispatcher(CANCEL); | 343 TakeActionOnResourceDispatcher(CANCEL); |
344 } | 344 } |
345 break; | 345 break; |
346 default: | 346 default: |
347 NOTREACHED(); | 347 NOTREACHED(); |
348 } | 348 } |
349 } | 349 } |
350 | 350 |
351 bool InterstitialPageImpl::OnMessageReceived(RenderFrameHost* render_frame_host, | 351 bool InterstitialPageImpl::OnMessageReceived( |
352 const IPC::Message& message) { | 352 RenderFrameHostImpl* render_frame_host, |
| 353 const IPC::Message& message) { |
353 if (render_frame_host->GetRenderViewHost() != render_view_host_) { | 354 if (render_frame_host->GetRenderViewHost() != render_view_host_) { |
354 DCHECK(!render_view_host_) | 355 DCHECK(!render_view_host_) |
355 << "We expect an interstitial page to have only a single RVH"; | 356 << "We expect an interstitial page to have only a single RVH"; |
356 return false; | 357 return false; |
357 } | 358 } |
358 | 359 |
359 bool handled = true; | 360 bool handled = true; |
360 IPC_BEGIN_MESSAGE_MAP(InterstitialPageImpl, message) | 361 IPC_BEGIN_MESSAGE_MAP_WITH_PARAM(InterstitialPageImpl, message, |
| 362 render_frame_host) |
361 IPC_MESSAGE_HANDLER(FrameHostMsg_DomOperationResponse, | 363 IPC_MESSAGE_HANDLER(FrameHostMsg_DomOperationResponse, |
362 OnDomOperationResponse) | 364 OnDomOperationResponse) |
363 IPC_MESSAGE_UNHANDLED(handled = false) | 365 IPC_MESSAGE_UNHANDLED(handled = false) |
364 IPC_END_MESSAGE_MAP() | 366 IPC_END_MESSAGE_MAP() |
365 | 367 |
366 return handled; | 368 return handled; |
367 } | 369 } |
368 | 370 |
369 bool InterstitialPageImpl::OnMessageReceived(RenderViewHost* render_view_host, | 371 bool InterstitialPageImpl::OnMessageReceived( |
370 const IPC::Message& message) { | 372 RenderViewHostImpl* render_view_host, |
| 373 const IPC::Message& message) { |
371 return false; | 374 return false; |
372 } | 375 } |
373 | 376 |
374 void InterstitialPageImpl::RenderFrameCreated( | 377 void InterstitialPageImpl::RenderFrameCreated( |
375 RenderFrameHost* render_frame_host) { | 378 RenderFrameHost* render_frame_host) { |
376 // Note this is only for subframes in the interstitial, the notification for | 379 // Note this is only for subframes in the interstitial, the notification for |
377 // the main frame happens in RenderViewCreated. | 380 // the main frame happens in RenderViewCreated. |
378 controller_->delegate()->RenderFrameForInterstitialPageCreated( | 381 controller_->delegate()->RenderFrameForInterstitialPageCreated( |
379 render_frame_host); | 382 render_frame_host); |
380 } | 383 } |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
835 ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI(rfh); | 838 ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI(rfh); |
836 break; | 839 break; |
837 default: | 840 default: |
838 DCHECK_EQ(action, CANCEL); | 841 DCHECK_EQ(action, CANCEL); |
839 ResourceDispatcherHostImpl::CancelBlockedRequestsForFrameFromUI(rfh); | 842 ResourceDispatcherHostImpl::CancelBlockedRequestsForFrameFromUI(rfh); |
840 break; | 843 break; |
841 } | 844 } |
842 } | 845 } |
843 | 846 |
844 void InterstitialPageImpl::OnDomOperationResponse( | 847 void InterstitialPageImpl::OnDomOperationResponse( |
| 848 RenderFrameHostImpl* source, |
845 const std::string& json_string) { | 849 const std::string& json_string) { |
846 std::string json = json_string; | 850 std::string json = json_string; |
847 // Needed by test code. | 851 // Needed by test code. |
848 NotificationService::current()->Notify(NOTIFICATION_DOM_OPERATION_RESPONSE, | 852 NotificationService::current()->Notify(NOTIFICATION_DOM_OPERATION_RESPONSE, |
849 Source<WebContents>(web_contents()), | 853 Source<WebContents>(web_contents()), |
850 Details<std::string>(&json)); | 854 Details<std::string>(&json)); |
851 | 855 |
852 if (!enabled()) | 856 if (!enabled()) |
853 return; | 857 return; |
854 delegate_->CommandReceived(json_string); | 858 delegate_->CommandReceived(json_string); |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 void InterstitialPageImpl::UpdateDeviceScaleFactor(double device_scale_factor) { | 956 void InterstitialPageImpl::UpdateDeviceScaleFactor(double device_scale_factor) { |
953 WebContentsImpl* web_contents_impl = | 957 WebContentsImpl* web_contents_impl = |
954 static_cast<WebContentsImpl*>(web_contents_); | 958 static_cast<WebContentsImpl*>(web_contents_); |
955 if (!web_contents_impl) | 959 if (!web_contents_impl) |
956 return; | 960 return; |
957 | 961 |
958 web_contents_impl->UpdateDeviceScaleFactor(device_scale_factor); | 962 web_contents_impl->UpdateDeviceScaleFactor(device_scale_factor); |
959 } | 963 } |
960 | 964 |
961 } // namespace content | 965 } // namespace content |
OLD | NEW |