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/web_contents_impl.h" | 5 #include "content/browser/web_contents/web_contents_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 #include "content/public/browser/notification_details.h" | 85 #include "content/public/browser/notification_details.h" |
86 #include "content/public/browser/notification_service.h" | 86 #include "content/public/browser/notification_service.h" |
87 #include "content/public/browser/render_widget_host_iterator.h" | 87 #include "content/public/browser/render_widget_host_iterator.h" |
88 #include "content/public/browser/resource_request_details.h" | 88 #include "content/public/browser/resource_request_details.h" |
89 #include "content/public/browser/screen_orientation_dispatcher_host.h" | 89 #include "content/public/browser/screen_orientation_dispatcher_host.h" |
90 #include "content/public/browser/security_style_explanations.h" | 90 #include "content/public/browser/security_style_explanations.h" |
91 #include "content/public/browser/storage_partition.h" | 91 #include "content/public/browser/storage_partition.h" |
92 #include "content/public/browser/user_metrics.h" | 92 #include "content/public/browser/user_metrics.h" |
93 #include "content/public/browser/web_contents_delegate.h" | 93 #include "content/public/browser/web_contents_delegate.h" |
94 #include "content/public/browser/web_contents_observer.h" | 94 #include "content/public/browser/web_contents_observer.h" |
| 95 #include "content/public/browser/web_contents_source.h" |
95 #include "content/public/common/bindings_policy.h" | 96 #include "content/public/common/bindings_policy.h" |
96 #include "content/public/common/browser_plugin_guest_mode.h" | 97 #include "content/public/common/browser_plugin_guest_mode.h" |
97 #include "content/public/common/content_constants.h" | 98 #include "content/public/common/content_constants.h" |
98 #include "content/public/common/content_switches.h" | 99 #include "content/public/common/content_switches.h" |
99 #include "content/public/common/page_zoom.h" | 100 #include "content/public/common/page_zoom.h" |
100 #include "content/public/common/result_codes.h" | 101 #include "content/public/common/result_codes.h" |
101 #include "content/public/common/security_style.h" | 102 #include "content/public/common/security_style.h" |
102 #include "content/public/common/url_constants.h" | 103 #include "content/public/common/url_constants.h" |
103 #include "content/public/common/url_utils.h" | 104 #include "content/public/common/url_utils.h" |
104 #include "content/public/common/web_preferences.h" | 105 #include "content/public/common/web_preferences.h" |
(...skipping 1671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1776 create_params.initially_hidden = true; | 1777 create_params.initially_hidden = true; |
1777 create_params.renderer_initiated_creation = | 1778 create_params.renderer_initiated_creation = |
1778 main_frame_route_id != MSG_ROUTING_NONE; | 1779 main_frame_route_id != MSG_ROUTING_NONE; |
1779 | 1780 |
1780 WebContentsImpl* new_contents = NULL; | 1781 WebContentsImpl* new_contents = NULL; |
1781 if (!is_guest) { | 1782 if (!is_guest) { |
1782 create_params.context = view_->GetNativeView(); | 1783 create_params.context = view_->GetNativeView(); |
1783 create_params.initial_size = GetContainerBounds().size(); | 1784 create_params.initial_size = GetContainerBounds().size(); |
1784 new_contents = static_cast<WebContentsImpl*>( | 1785 new_contents = static_cast<WebContentsImpl*>( |
1785 WebContents::Create(create_params)); | 1786 WebContents::Create(create_params)); |
| 1787 WebContentsSource::CreateForWebContentsAndLocation(new_contents, FROM_HERE); |
1786 } else { | 1788 } else { |
1787 new_contents = GetBrowserPluginGuest()->CreateNewGuestWindow(create_params); | 1789 new_contents = GetBrowserPluginGuest()->CreateNewGuestWindow(create_params); |
1788 } | 1790 } |
1789 new_contents->GetController().SetSessionStorageNamespace( | 1791 new_contents->GetController().SetSessionStorageNamespace( |
1790 partition_id, | 1792 partition_id, |
1791 session_storage_namespace); | 1793 session_storage_namespace); |
1792 | 1794 |
1793 // If the new frame has a name, make sure any SiteInstances that can find | 1795 // If the new frame has a name, make sure any SiteInstances that can find |
1794 // this named frame have proxies for it. Must be called after | 1796 // this named frame have proxies for it. Must be called after |
1795 // SetSessionStorageNamespace, since this calls CreateRenderView, which uses | 1797 // SetSessionStorageNamespace, since this calls CreateRenderView, which uses |
(...skipping 2941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4737 return NULL; | 4739 return NULL; |
4738 } | 4740 } |
4739 | 4741 |
4740 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { | 4742 void WebContentsImpl::SetForceDisableOverscrollContent(bool force_disable) { |
4741 force_disable_overscroll_content_ = force_disable; | 4743 force_disable_overscroll_content_ = force_disable; |
4742 if (view_) | 4744 if (view_) |
4743 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); | 4745 view_->SetOverscrollControllerEnabled(CanOverscrollContent()); |
4744 } | 4746 } |
4745 | 4747 |
4746 } // namespace content | 4748 } // namespace content |
OLD | NEW |