| 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" |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/location.h" | 12 #include "base/location.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 15 #include "base/single_thread_task_runner.h" | 15 #include "base/single_thread_task_runner.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 18 #include "base/threading/thread.h" | 18 #include "base/threading/thread.h" |
| 19 #include "base/threading/thread_task_runner_handle.h" | 19 #include "base/threading/thread_task_runner_handle.h" |
| 20 #include "build/build_config.h" | 20 #include "build/build_config.h" |
| 21 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 21 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
| 22 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 22 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
| 23 #include "content/browser/frame_host/interstitial_page_navigator_impl.h" | 23 #include "content/browser/frame_host/interstitial_page_navigator_impl.h" |
| 24 #include "content/browser/frame_host/navigation_controller_impl.h" | 24 #include "content/browser/frame_host/navigation_controller_impl.h" |
| 25 #include "content/browser/frame_host/navigation_entry_impl.h" | 25 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 26 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 26 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 27 #include "content/browser/renderer_host/render_process_host_impl.h" | 27 #include "content/browser/renderer_host/render_process_host_impl.h" |
| 28 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 28 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
| 29 #include "content/browser/renderer_host/render_view_host_factory.h" | 29 #include "content/browser/renderer_host/render_view_host_factory.h" |
| 30 #include "content/browser/renderer_host/render_view_host_impl.h" | 30 #include "content/browser/renderer_host/render_view_host_impl.h" |
| 31 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 31 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
| 32 #include "content/browser/renderer_host/text_input_manager.h" | 32 #include "content/browser/renderer_host/text_input_manager.h" |
| 33 #include "content/browser/site_instance_impl.h" | 33 #include "content/browser/site_instance_impl.h" |
| 34 #include "content/browser/web_contents/web_contents_impl.h" | 34 #include "content/browser/web_contents/web_contents_impl.h" |
| 35 #include "content/browser/web_contents/web_contents_view.h" | 35 #include "content/browser/web_contents/web_contents_view.h" |
| 36 #include "content/common/features.h" | 36 #include "content/common/features.h" |
| (...skipping 804 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 841 RenderFrameHostImpl* rfh = | 841 RenderFrameHostImpl* rfh = |
| 842 static_cast<RenderFrameHostImpl*>(rvh->GetMainFrame()); | 842 static_cast<RenderFrameHostImpl*>(rvh->GetMainFrame()); |
| 843 // Note, the RenderViewHost can lose its main frame if a new RenderFrameHost | 843 // Note, the RenderViewHost can lose its main frame if a new RenderFrameHost |
| 844 // commits with a new RenderViewHost. Additionally, RenderViewHosts for OOPIF | 844 // commits with a new RenderViewHost. Additionally, RenderViewHosts for OOPIF |
| 845 // don't have main frames. | 845 // don't have main frames. |
| 846 if (!rfh) | 846 if (!rfh) |
| 847 return; | 847 return; |
| 848 | 848 |
| 849 switch (action) { | 849 switch (action) { |
| 850 case BLOCK: | 850 case BLOCK: |
| 851 ResourceDispatcherHost::BlockRequestsForFrameFromUI(rfh); | 851 rfh->BlockRequestsForFrame(); |
| 852 break; | 852 break; |
| 853 case RESUME: | 853 case RESUME: |
| 854 ResourceDispatcherHost::ResumeBlockedRequestsForFrameFromUI(rfh); | 854 rfh->ResumeBlockedRequestsForFrame(); |
| 855 break; | 855 break; |
| 856 default: | 856 default: |
| 857 DCHECK_EQ(action, CANCEL); | 857 DCHECK_EQ(action, CANCEL); |
| 858 ResourceDispatcherHostImpl::CancelBlockedRequestsForFrameFromUI(rfh); | 858 rfh->CancelBlockedRequestsForFrame(); |
| 859 break; | 859 break; |
| 860 } | 860 } |
| 861 } | 861 } |
| 862 | 862 |
| 863 void InterstitialPageImpl::OnDomOperationResponse( | 863 void InterstitialPageImpl::OnDomOperationResponse( |
| 864 RenderFrameHostImpl* source, | 864 RenderFrameHostImpl* source, |
| 865 const std::string& json_string) { | 865 const std::string& json_string) { |
| 866 std::string json = json_string; | 866 std::string json = json_string; |
| 867 // Needed by test code. | 867 // Needed by test code. |
| 868 NotificationService::current()->Notify(NOTIFICATION_DOM_OPERATION_RESPONSE, | 868 NotificationService::current()->Notify(NOTIFICATION_DOM_OPERATION_RESPONSE, |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 void InterstitialPageImpl::UpdateDeviceScaleFactor(double device_scale_factor) { | 972 void InterstitialPageImpl::UpdateDeviceScaleFactor(double device_scale_factor) { |
| 973 WebContentsImpl* web_contents_impl = | 973 WebContentsImpl* web_contents_impl = |
| 974 static_cast<WebContentsImpl*>(web_contents_); | 974 static_cast<WebContentsImpl*>(web_contents_); |
| 975 if (!web_contents_impl) | 975 if (!web_contents_impl) |
| 976 return; | 976 return; |
| 977 | 977 |
| 978 web_contents_impl->UpdateDeviceScaleFactor(device_scale_factor); | 978 web_contents_impl->UpdateDeviceScaleFactor(device_scale_factor); |
| 979 } | 979 } |
| 980 | 980 |
| 981 } // namespace content | 981 } // namespace content |
| OLD | NEW |