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/tab_contents/interstitial_page.h" | 5 #include "content/browser/tab_contents/interstitial_page.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/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
13 #include "base/threading/thread.h" | 13 #include "base/threading/thread.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "content/browser/renderer_host/render_process_host_impl.h" | 15 #include "content/browser/renderer_host/render_process_host_impl.h" |
16 #include "content/browser/renderer_host/render_view_host.h" | 16 #include "content/browser/renderer_host/render_view_host.h" |
17 #include "content/browser/renderer_host/render_widget_host_view.h" | 17 #include "content/browser/renderer_host/render_widget_host_view.h" |
18 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 18 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
19 #include "content/browser/site_instance.h" | 19 #include "content/browser/site_instance_impl.h" |
20 #include "content/browser/tab_contents/navigation_controller_impl.h" | 20 #include "content/browser/tab_contents/navigation_controller_impl.h" |
21 #include "content/browser/tab_contents/navigation_entry_impl.h" | 21 #include "content/browser/tab_contents/navigation_entry_impl.h" |
22 #include "content/browser/tab_contents/tab_contents.h" | 22 #include "content/browser/tab_contents/tab_contents.h" |
23 #include "content/common/dom_storage_common.h" | 23 #include "content/common/dom_storage_common.h" |
24 #include "content/common/view_messages.h" | 24 #include "content/common/view_messages.h" |
25 #include "content/public/browser/browser_thread.h" | 25 #include "content/public/browser/browser_thread.h" |
26 #include "content/public/browser/content_browser_client.h" | 26 #include "content/public/browser/content_browser_client.h" |
27 #include "content/public/browser/invalidate_type.h" | 27 #include "content/public/browser/invalidate_type.h" |
28 #include "content/public/browser/notification_service.h" | 28 #include "content/public/browser/notification_service.h" |
29 #include "content/public/browser/notification_source.h" | 29 #include "content/public/browser/notification_source.h" |
30 #include "content/public/browser/web_contents_view.h" | 30 #include "content/public/browser/web_contents_view.h" |
31 #include "content/public/common/bindings_policy.h" | 31 #include "content/public/common/bindings_policy.h" |
32 #include "content/public/common/page_transition_types.h" | 32 #include "content/public/common/page_transition_types.h" |
33 #include "content/public/common/view_type.h" | 33 #include "content/public/common/view_type.h" |
34 #include "net/base/escape.h" | 34 #include "net/base/escape.h" |
35 #include "net/url_request/url_request_context_getter.h" | 35 #include "net/url_request/url_request_context_getter.h" |
36 | 36 |
37 using content::BrowserThread; | 37 using content::BrowserThread; |
38 using content::NavigationController; | 38 using content::NavigationController; |
39 using content::NavigationEntry; | 39 using content::NavigationEntry; |
40 using content::NavigationEntryImpl; | 40 using content::NavigationEntryImpl; |
41 using content::RenderViewHostDelegate; | 41 using content::RenderViewHostDelegate; |
| 42 using content::SiteInstance; |
42 using content::WebContents; | 43 using content::WebContents; |
43 using content::WebContentsView; | 44 using content::WebContentsView; |
44 using WebKit::WebDragOperation; | 45 using WebKit::WebDragOperation; |
45 using WebKit::WebDragOperationsMask; | 46 using WebKit::WebDragOperationsMask; |
46 | 47 |
47 namespace { | 48 namespace { |
48 | 49 |
49 void ResourceRequestHelper(ResourceDispatcherHost* resource_dispatcher_host, | 50 void ResourceRequestHelper(ResourceDispatcherHost* resource_dispatcher_host, |
50 int process_id, | 51 int process_id, |
51 int render_view_host_id, | 52 int render_view_host_id, |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 const NativeWebKeyboardEvent& event) { | 423 const NativeWebKeyboardEvent& event) { |
423 return tab_->HandleKeyboardEvent(event); | 424 return tab_->HandleKeyboardEvent(event); |
424 } | 425 } |
425 | 426 |
426 WebContents* InterstitialPage::tab() const { | 427 WebContents* InterstitialPage::tab() const { |
427 return tab_; | 428 return tab_; |
428 } | 429 } |
429 | 430 |
430 RenderViewHost* InterstitialPage::CreateRenderViewHost() { | 431 RenderViewHost* InterstitialPage::CreateRenderViewHost() { |
431 RenderViewHost* render_view_host = new RenderViewHost( | 432 RenderViewHost* render_view_host = new RenderViewHost( |
432 SiteInstance::CreateSiteInstance(tab()->GetBrowserContext()), | 433 SiteInstance::Create(tab()->GetBrowserContext()), |
433 this, MSG_ROUTING_NONE, kInvalidSessionStorageNamespaceId); | 434 this, MSG_ROUTING_NONE, kInvalidSessionStorageNamespaceId); |
434 return render_view_host; | 435 return render_view_host; |
435 } | 436 } |
436 | 437 |
437 WebContentsView* InterstitialPage::CreateWebContentsView() { | 438 WebContentsView* InterstitialPage::CreateWebContentsView() { |
438 WebContentsView* web_contents_view = tab()->GetView(); | 439 WebContentsView* web_contents_view = tab()->GetView(); |
439 RenderWidgetHostView* view = | 440 RenderWidgetHostView* view = |
440 web_contents_view->CreateViewForWidget(render_view_host_); | 441 web_contents_view->CreateViewForWidget(render_view_host_); |
441 render_view_host_->SetView(view); | 442 render_view_host_->SetView(view); |
442 render_view_host_->AllowBindings(content::BINDINGS_POLICY_DOM_AUTOMATION); | 443 render_view_host_->AllowBindings(content::BINDINGS_POLICY_DOM_AUTOMATION); |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 if (!tab->GetViewDelegate()) | 691 if (!tab->GetViewDelegate()) |
691 return; | 692 return; |
692 | 693 |
693 tab->GetViewDelegate()->TakeFocus(reverse); | 694 tab->GetViewDelegate()->TakeFocus(reverse); |
694 } | 695 } |
695 | 696 |
696 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( | 697 void InterstitialPage::InterstitialPageRVHViewDelegate::OnFindReply( |
697 int request_id, int number_of_matches, const gfx::Rect& selection_rect, | 698 int request_id, int number_of_matches, const gfx::Rect& selection_rect, |
698 int active_match_ordinal, bool final_update) { | 699 int active_match_ordinal, bool final_update) { |
699 } | 700 } |
OLD | NEW |