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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/location.h" | 11 #include "base/location.h" |
12 #include "base/single_thread_task_runner.h" | 12 #include "base/single_thread_task_runner.h" |
13 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
15 #include "base/thread_task_runner_handle.h" | 15 #include "base/thread_task_runner_handle.h" |
16 #include "base/threading/thread.h" | 16 #include "base/threading/thread.h" |
17 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" | 17 #include "content/browser/dom_storage/dom_storage_context_wrapper.h" |
18 #include "content/browser/dom_storage/session_storage_namespace_impl.h" | 18 #include "content/browser/dom_storage/session_storage_namespace_impl.h" |
19 #include "content/browser/frame_host/interstitial_page_navigator_impl.h" | 19 #include "content/browser/frame_host/interstitial_page_navigator_impl.h" |
20 #include "content/browser/frame_host/navigation_controller_impl.h" | 20 #include "content/browser/frame_host/navigation_controller_impl.h" |
21 #include "content/browser/frame_host/navigation_entry_impl.h" | 21 #include "content/browser/frame_host/navigation_entry_impl.h" |
| 22 #include "content/browser/gpu/gpu_surface_tracker.h" |
22 #include "content/browser/loader/resource_dispatcher_host_impl.h" | 23 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
23 #include "content/browser/renderer_host/render_process_host_impl.h" | 24 #include "content/browser/renderer_host/render_process_host_impl.h" |
24 #include "content/browser/renderer_host/render_view_host_delegate_view.h" | 25 #include "content/browser/renderer_host/render_view_host_delegate_view.h" |
25 #include "content/browser/renderer_host/render_view_host_factory.h" | 26 #include "content/browser/renderer_host/render_view_host_factory.h" |
26 #include "content/browser/renderer_host/render_view_host_impl.h" | 27 #include "content/browser/renderer_host/render_view_host_impl.h" |
27 #include "content/browser/renderer_host/render_widget_host_view_base.h" | 28 #include "content/browser/renderer_host/render_widget_host_view_base.h" |
28 #include "content/browser/site_instance_impl.h" | 29 #include "content/browser/site_instance_impl.h" |
29 #include "content/browser/web_contents/web_contents_impl.h" | 30 #include "content/browser/web_contents/web_contents_impl.h" |
30 #include "content/browser/web_contents/web_contents_view.h" | 31 #include "content/browser/web_contents/web_contents_view.h" |
31 #include "content/common/frame_messages.h" | 32 #include "content/common/frame_messages.h" |
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 scoped_refptr<SiteInstance> site_instance = | 585 scoped_refptr<SiteInstance> site_instance = |
585 SiteInstance::Create(browser_context); | 586 SiteInstance::Create(browser_context); |
586 DOMStorageContextWrapper* dom_storage_context = | 587 DOMStorageContextWrapper* dom_storage_context = |
587 static_cast<DOMStorageContextWrapper*>( | 588 static_cast<DOMStorageContextWrapper*>( |
588 BrowserContext::GetStoragePartition( | 589 BrowserContext::GetStoragePartition( |
589 browser_context, site_instance.get())->GetDOMStorageContext()); | 590 browser_context, site_instance.get())->GetDOMStorageContext()); |
590 session_storage_namespace_ = | 591 session_storage_namespace_ = |
591 new SessionStorageNamespaceImpl(dom_storage_context); | 592 new SessionStorageNamespaceImpl(dom_storage_context); |
592 | 593 |
593 // Use the RenderViewHost from our FrameTree. | 594 // Use the RenderViewHost from our FrameTree. |
594 frame_tree_.root()->render_manager()->Init( | 595 int32 widget_routing_id = site_instance->GetProcess()->GetNextRoutingID(); |
595 browser_context, site_instance.get(), MSG_ROUTING_NONE, MSG_ROUTING_NONE, | 596 int32 surface_id = GpuSurfaceTracker::Get()->AddSurfaceForRenderer( |
596 MSG_ROUTING_NONE, 0 /* surface_id */); | 597 site_instance->GetProcess()->GetID(), widget_routing_id); |
| 598 frame_tree_.root()->render_manager()->Init(site_instance.get(), |
| 599 MSG_ROUTING_NONE, MSG_ROUTING_NONE, |
| 600 widget_routing_id, surface_id); |
597 return frame_tree_.root()->current_frame_host()->render_view_host(); | 601 return frame_tree_.root()->current_frame_host()->render_view_host(); |
598 } | 602 } |
599 | 603 |
600 WebContentsView* InterstitialPageImpl::CreateWebContentsView() { | 604 WebContentsView* InterstitialPageImpl::CreateWebContentsView() { |
601 if (!enabled() || !create_view_) | 605 if (!enabled() || !create_view_) |
602 return NULL; | 606 return NULL; |
603 WebContentsView* wcv = | 607 WebContentsView* wcv = |
604 static_cast<WebContentsImpl*>(web_contents())->GetView(); | 608 static_cast<WebContentsImpl*>(web_contents())->GetView(); |
605 RenderWidgetHostViewBase* view = | 609 RenderWidgetHostViewBase* view = |
606 wcv->CreateViewForWidget(render_view_host_, false); | 610 wcv->CreateViewForWidget(render_view_host_, false); |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
750 void InterstitialPageImpl::DontCreateViewForTesting() { | 754 void InterstitialPageImpl::DontCreateViewForTesting() { |
751 create_view_ = false; | 755 create_view_ = false; |
752 } | 756 } |
753 | 757 |
754 gfx::Rect InterstitialPageImpl::GetRootWindowResizerRect() const { | 758 gfx::Rect InterstitialPageImpl::GetRootWindowResizerRect() const { |
755 return gfx::Rect(); | 759 return gfx::Rect(); |
756 } | 760 } |
757 | 761 |
758 void InterstitialPageImpl::CreateNewWindow( | 762 void InterstitialPageImpl::CreateNewWindow( |
759 SiteInstance* source_site_instance, | 763 SiteInstance* source_site_instance, |
760 int route_id, | 764 int32 route_id, |
761 int main_frame_route_id, | 765 int32 main_frame_route_id, |
| 766 int32 main_frame_widget_route_id, |
| 767 int32 surface_id, |
762 const ViewHostMsg_CreateWindow_Params& params, | 768 const ViewHostMsg_CreateWindow_Params& params, |
763 SessionStorageNamespace* session_storage_namespace) { | 769 SessionStorageNamespace* session_storage_namespace) { |
764 NOTREACHED() << "InterstitialPage does not support showing popups yet."; | 770 NOTREACHED() << "InterstitialPage does not support showing popups yet."; |
765 } | 771 } |
766 | 772 |
767 void InterstitialPageImpl::CreateNewWidget(int32 render_process_id, | 773 void InterstitialPageImpl::CreateNewWidget(int32 render_process_id, |
768 int32 route_id, | 774 int32 route_id, |
769 int32 surface_id, | 775 int32 surface_id, |
770 blink::WebPopupType popup_type) { | 776 blink::WebPopupType popup_type) { |
771 NOTREACHED() << "InterstitialPage does not support showing drop-downs yet."; | 777 NOTREACHED() << "InterstitialPage does not support showing drop-downs yet."; |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
943 void InterstitialPageImpl::UnderlyingContentObserver::NavigationEntryCommitted( | 949 void InterstitialPageImpl::UnderlyingContentObserver::NavigationEntryCommitted( |
944 const LoadCommittedDetails& load_details) { | 950 const LoadCommittedDetails& load_details) { |
945 interstitial_->OnNavigatingAwayOrTabClosing(); | 951 interstitial_->OnNavigatingAwayOrTabClosing(); |
946 } | 952 } |
947 | 953 |
948 void InterstitialPageImpl::UnderlyingContentObserver::WebContentsDestroyed() { | 954 void InterstitialPageImpl::UnderlyingContentObserver::WebContentsDestroyed() { |
949 interstitial_->OnNavigatingAwayOrTabClosing(); | 955 interstitial_->OnNavigatingAwayOrTabClosing(); |
950 } | 956 } |
951 | 957 |
952 } // namespace content | 958 } // namespace content |
OLD | NEW |