| 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 14 matching lines...) Expand all Loading... |
| 25 #include "content/port/browser/render_view_host_delegate_view.h" | 25 #include "content/port/browser/render_view_host_delegate_view.h" |
| 26 #include "content/port/browser/render_widget_host_view_port.h" | 26 #include "content/port/browser/render_widget_host_view_port.h" |
| 27 #include "content/public/browser/browser_context.h" | 27 #include "content/public/browser/browser_context.h" |
| 28 #include "content/public/browser/browser_thread.h" | 28 #include "content/public/browser/browser_thread.h" |
| 29 #include "content/public/browser/content_browser_client.h" | 29 #include "content/public/browser/content_browser_client.h" |
| 30 #include "content/public/browser/dom_operation_notification_details.h" | 30 #include "content/public/browser/dom_operation_notification_details.h" |
| 31 #include "content/public/browser/interstitial_page_delegate.h" | 31 #include "content/public/browser/interstitial_page_delegate.h" |
| 32 #include "content/public/browser/invalidate_type.h" | 32 #include "content/public/browser/invalidate_type.h" |
| 33 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
| 34 #include "content/public/browser/notification_source.h" | 34 #include "content/public/browser/notification_source.h" |
| 35 #include "content/public/browser/storage_partition.h" |
| 35 #include "content/public/browser/web_contents_view.h" | 36 #include "content/public/browser/web_contents_view.h" |
| 36 #include "content/public/common/bindings_policy.h" | 37 #include "content/public/common/bindings_policy.h" |
| 37 #include "content/public/common/page_transition_types.h" | 38 #include "content/public/common/page_transition_types.h" |
| 38 #include "net/base/escape.h" | 39 #include "net/base/escape.h" |
| 39 #include "net/url_request/url_request_context_getter.h" | 40 #include "net/url_request/url_request_context_getter.h" |
| 40 | 41 |
| 41 using content::BrowserThread; | 42 using content::BrowserThread; |
| 42 using content::DomOperationNotificationDetails; | 43 using content::DomOperationNotificationDetails; |
| 43 using content::InterstitialPageDelegate; | 44 using content::InterstitialPageDelegate; |
| 44 using content::NativeWebKeyboardEvent; | 45 using content::NativeWebKeyboardEvent; |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 return web_contents_; | 481 return web_contents_; |
| 481 } | 482 } |
| 482 | 483 |
| 483 RenderViewHost* InterstitialPageImpl::CreateRenderViewHost() { | 484 RenderViewHost* InterstitialPageImpl::CreateRenderViewHost() { |
| 484 // Interstitial pages don't want to share the session storage so we mint a | 485 // Interstitial pages don't want to share the session storage so we mint a |
| 485 // new one. | 486 // new one. |
| 486 using content::BrowserContext; | 487 using content::BrowserContext; |
| 487 BrowserContext* browser_context = web_contents()->GetBrowserContext(); | 488 BrowserContext* browser_context = web_contents()->GetBrowserContext(); |
| 488 scoped_refptr<SiteInstance> site_instance = | 489 scoped_refptr<SiteInstance> site_instance = |
| 489 SiteInstance::Create(browser_context); | 490 SiteInstance::Create(browser_context); |
| 490 const std::string& partition_id = | |
| 491 content::GetContentClient()->browser()-> | |
| 492 GetStoragePartitionIdForSiteInstance(browser_context, | |
| 493 site_instance); | |
| 494 DOMStorageContextImpl* dom_storage_context = | 491 DOMStorageContextImpl* dom_storage_context = |
| 495 static_cast<DOMStorageContextImpl*>( | 492 static_cast<DOMStorageContextImpl*>( |
| 496 BrowserContext::GetDOMStorageContextByPartitionId(browser_context, | 493 BrowserContext::GetStoragePartition( |
| 497 partition_id)); | 494 browser_context, site_instance)->GetDOMStorageContext()); |
| 498 SessionStorageNamespaceImpl* session_storage_namespace_impl = | 495 SessionStorageNamespaceImpl* session_storage_namespace_impl = |
| 499 new SessionStorageNamespaceImpl(dom_storage_context); | 496 new SessionStorageNamespaceImpl(dom_storage_context); |
| 500 | 497 |
| 501 RenderViewHostImpl* render_view_host = new RenderViewHostImpl( | 498 RenderViewHostImpl* render_view_host = new RenderViewHostImpl( |
| 502 site_instance, this, this, MSG_ROUTING_NONE, false, | 499 site_instance, this, this, MSG_ROUTING_NONE, false, |
| 503 session_storage_namespace_impl); | 500 session_storage_namespace_impl); |
| 504 web_contents_->RenderViewForInterstitialPageCreated(render_view_host); | 501 web_contents_->RenderViewForInterstitialPageCreated(render_view_host); |
| 505 return render_view_host; | 502 return render_view_host; |
| 506 } | 503 } |
| 507 | 504 |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 if (!web_contents->GetDelegateView()) | 755 if (!web_contents->GetDelegateView()) |
| 759 return; | 756 return; |
| 760 | 757 |
| 761 web_contents->GetDelegateView()->TakeFocus(reverse); | 758 web_contents->GetDelegateView()->TakeFocus(reverse); |
| 762 } | 759 } |
| 763 | 760 |
| 764 void InterstitialPageImpl::InterstitialPageRVHDelegateView::OnFindReply( | 761 void InterstitialPageImpl::InterstitialPageRVHDelegateView::OnFindReply( |
| 765 int request_id, int number_of_matches, const gfx::Rect& selection_rect, | 762 int request_id, int number_of_matches, const gfx::Rect& selection_rect, |
| 766 int active_match_ordinal, bool final_update) { | 763 int active_match_ordinal, bool final_update) { |
| 767 } | 764 } |
| OLD | NEW |