OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_contents/interstitial_page_impl.h" | 5 #include "content/browser/web_contents/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" |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 return NULL; | 486 return NULL; |
487 | 487 |
488 // Interstitial pages don't want to share the session storage so we mint a | 488 // Interstitial pages don't want to share the session storage so we mint a |
489 // new one. | 489 // new one. |
490 BrowserContext* browser_context = web_contents()->GetBrowserContext(); | 490 BrowserContext* browser_context = web_contents()->GetBrowserContext(); |
491 scoped_refptr<SiteInstance> site_instance = | 491 scoped_refptr<SiteInstance> site_instance = |
492 SiteInstance::Create(browser_context); | 492 SiteInstance::Create(browser_context); |
493 DOMStorageContextImpl* dom_storage_context = | 493 DOMStorageContextImpl* dom_storage_context = |
494 static_cast<DOMStorageContextImpl*>(BrowserContext::GetStoragePartition( | 494 static_cast<DOMStorageContextImpl*>(BrowserContext::GetStoragePartition( |
495 browser_context, site_instance.get())->GetDOMStorageContext()); | 495 browser_context, site_instance.get())->GetDOMStorageContext()); |
496 SessionStorageNamespaceImpl* session_storage_namespace_impl = | 496 session_storage_namespace_ = |
497 new SessionStorageNamespaceImpl(dom_storage_context); | 497 new SessionStorageNamespaceImpl(dom_storage_context); |
498 | 498 |
499 RenderViewHostImpl* render_view_host = | 499 RenderViewHostImpl* render_view_host = |
500 new RenderViewHostImpl(site_instance.get(), | 500 new RenderViewHostImpl(site_instance.get(), |
501 this, | 501 this, |
502 this, | 502 this, |
503 MSG_ROUTING_NONE, | 503 MSG_ROUTING_NONE, |
504 MSG_ROUTING_NONE, | 504 MSG_ROUTING_NONE, |
505 false, | 505 false); |
506 session_storage_namespace_impl); | |
507 web_contents_->RenderViewForInterstitialPageCreated(render_view_host); | 506 web_contents_->RenderViewForInterstitialPageCreated(render_view_host); |
508 return render_view_host; | 507 return render_view_host; |
509 } | 508 } |
510 | 509 |
511 WebContentsView* InterstitialPageImpl::CreateWebContentsView() { | 510 WebContentsView* InterstitialPageImpl::CreateWebContentsView() { |
512 if (!enabled() || !create_view_) | 511 if (!enabled() || !create_view_) |
513 return NULL; | 512 return NULL; |
514 WebContentsView* web_contents_view = web_contents()->GetView(); | 513 WebContentsView* web_contents_view = web_contents()->GetView(); |
515 WebContentsViewPort* web_contents_view_port = | 514 WebContentsViewPort* web_contents_view_port = |
516 static_cast<WebContentsViewPort*>(web_contents_view); | 515 static_cast<WebContentsViewPort*>(web_contents_view); |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
697 void InterstitialPageImpl::ShowCreatedWidget(int route_id, | 696 void InterstitialPageImpl::ShowCreatedWidget(int route_id, |
698 const gfx::Rect& initial_pos) { | 697 const gfx::Rect& initial_pos) { |
699 NOTREACHED() << "InterstitialPage does not support showing drop-downs yet."; | 698 NOTREACHED() << "InterstitialPage does not support showing drop-downs yet."; |
700 } | 699 } |
701 | 700 |
702 void InterstitialPageImpl::ShowCreatedFullscreenWidget(int route_id) { | 701 void InterstitialPageImpl::ShowCreatedFullscreenWidget(int route_id) { |
703 NOTREACHED() | 702 NOTREACHED() |
704 << "InterstitialPage does not support showing full screen popups."; | 703 << "InterstitialPage does not support showing full screen popups."; |
705 } | 704 } |
706 | 705 |
| 706 SessionStorageNamespace* InterstitialPageImpl::GetSessionStorageNamespace( |
| 707 SiteInstance* instance) { |
| 708 return session_storage_namespace_.get(); |
| 709 } |
| 710 |
707 void InterstitialPageImpl::Disable() { | 711 void InterstitialPageImpl::Disable() { |
708 enabled_ = false; | 712 enabled_ = false; |
709 } | 713 } |
710 | 714 |
711 void InterstitialPageImpl::Shutdown(RenderViewHostImpl* render_view_host) { | 715 void InterstitialPageImpl::Shutdown(RenderViewHostImpl* render_view_host) { |
712 render_view_host->Shutdown(); | 716 render_view_host->Shutdown(); |
713 // We are deleted now. | 717 // We are deleted now. |
714 } | 718 } |
715 | 719 |
716 void InterstitialPageImpl::OnNavigatingAwayOrTabClosing() { | 720 void InterstitialPageImpl::OnNavigatingAwayOrTabClosing() { |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
806 | 810 |
807 web_contents->GetDelegateView()->TakeFocus(reverse); | 811 web_contents->GetDelegateView()->TakeFocus(reverse); |
808 } | 812 } |
809 | 813 |
810 void InterstitialPageImpl::InterstitialPageRVHDelegateView::OnFindReply( | 814 void InterstitialPageImpl::InterstitialPageRVHDelegateView::OnFindReply( |
811 int request_id, int number_of_matches, const gfx::Rect& selection_rect, | 815 int request_id, int number_of_matches, const gfx::Rect& selection_rect, |
812 int active_match_ordinal, bool final_update) { | 816 int active_match_ordinal, bool final_update) { |
813 } | 817 } |
814 | 818 |
815 } // namespace content | 819 } // namespace content |
OLD | NEW |