| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/renderer_host/render_view_host.h" | 5 #include "chrome/browser/renderer_host/render_view_host.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 Singleton<CrossSiteRequestManager>()->SetHasPendingCrossSiteRequest( | 139 Singleton<CrossSiteRequestManager>()->SetHasPendingCrossSiteRequest( |
| 140 process()->id(), routing_id(), false); | 140 process()->id(), routing_id(), false); |
| 141 | 141 |
| 142 NotificationService::current()->Notify( | 142 NotificationService::current()->Notify( |
| 143 NotificationType::EXTENSION_PORT_DELETED_DEBUG, | 143 NotificationType::EXTENSION_PORT_DELETED_DEBUG, |
| 144 Source<IPC::Message::Sender>(this), | 144 Source<IPC::Message::Sender>(this), |
| 145 NotificationService::NoDetails()); | 145 NotificationService::NoDetails()); |
| 146 } | 146 } |
| 147 | 147 |
| 148 bool RenderViewHost::CreateRenderView( | 148 bool RenderViewHost::CreateRenderView( |
| 149 URLRequestContextGetter* request_context) { | 149 URLRequestContextGetter* request_context, const string16& frame_name) { |
| 150 DCHECK(!IsRenderViewLive()) << "Creating view twice"; | 150 DCHECK(!IsRenderViewLive()) << "Creating view twice"; |
| 151 | 151 |
| 152 // The process may (if we're sharing a process with another host that already | 152 // The process may (if we're sharing a process with another host that already |
| 153 // initialized it) or may not (we have our own process or the old process | 153 // initialized it) or may not (we have our own process or the old process |
| 154 // crashed) have been initialized. Calling Init multiple times will be | 154 // crashed) have been initialized. Calling Init multiple times will be |
| 155 // ignored, so this is safe. | 155 // ignored, so this is safe. |
| 156 if (!process()->Init(is_extension_process_, request_context)) | 156 if (!process()->Init(is_extension_process_, request_context)) |
| 157 return false; | 157 return false; |
| 158 DCHECK(process()->HasConnection()); | 158 DCHECK(process()->HasConnection()); |
| 159 DCHECK(process()->profile()); | 159 DCHECK(process()->profile()); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 184 webkit_prefs.databases_enabled = true; | 184 webkit_prefs.databases_enabled = true; |
| 185 } | 185 } |
| 186 | 186 |
| 187 ViewMsg_New_Params params; | 187 ViewMsg_New_Params params; |
| 188 params.parent_window = GetNativeViewId(); | 188 params.parent_window = GetNativeViewId(); |
| 189 params.renderer_preferences = | 189 params.renderer_preferences = |
| 190 delegate_->GetRendererPrefs(process()->profile()); | 190 delegate_->GetRendererPrefs(process()->profile()); |
| 191 params.web_preferences = webkit_prefs; | 191 params.web_preferences = webkit_prefs; |
| 192 params.view_id = routing_id(); | 192 params.view_id = routing_id(); |
| 193 params.session_storage_namespace_id = session_storage_namespace_id_; | 193 params.session_storage_namespace_id = session_storage_namespace_id_; |
| 194 params.frame_name = frame_name; |
| 194 Send(new ViewMsg_New(params)); | 195 Send(new ViewMsg_New(params)); |
| 195 | 196 |
| 196 // Set the alternate error page, which is profile specific, in the renderer. | 197 // Set the alternate error page, which is profile specific, in the renderer. |
| 197 GURL url = delegate_->GetAlternateErrorPageURL(); | 198 GURL url = delegate_->GetAlternateErrorPageURL(); |
| 198 SetAlternateErrorPageURL(url); | 199 SetAlternateErrorPageURL(url); |
| 199 | 200 |
| 200 // If it's enabled, tell the renderer to set up the Javascript bindings for | 201 // If it's enabled, tell the renderer to set up the Javascript bindings for |
| 201 // sending messages back to the browser. | 202 // sending messages back to the browser. |
| 202 Send(new ViewMsg_AllowBindings(routing_id(), enabled_bindings_)); | 203 Send(new ViewMsg_AllowBindings(routing_id(), enabled_bindings_)); |
| 203 UpdateBrowserWindowId(delegate_->GetBrowserWindowID()); | 204 UpdateBrowserWindowId(delegate_->GetBrowserWindowID()); |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 856 | 857 |
| 857 DevToolsManager* devtools_manager = DevToolsManager::GetInstance(); | 858 DevToolsManager* devtools_manager = DevToolsManager::GetInstance(); |
| 858 if (devtools_manager) // NULL in tests | 859 if (devtools_manager) // NULL in tests |
| 859 devtools_manager->UnregisterDevToolsClientHostFor(this); | 860 devtools_manager->UnregisterDevToolsClientHostFor(this); |
| 860 | 861 |
| 861 RenderWidgetHost::Shutdown(); | 862 RenderWidgetHost::Shutdown(); |
| 862 } | 863 } |
| 863 | 864 |
| 864 void RenderViewHost::CreateNewWindow( | 865 void RenderViewHost::CreateNewWindow( |
| 865 int route_id, | 866 int route_id, |
| 866 WindowContainerType window_container_type) { | 867 WindowContainerType window_container_type, |
| 868 const string16& frame_name) { |
| 867 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); | 869 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); |
| 868 if (!view) | 870 if (!view) |
| 869 return; | 871 return; |
| 870 | 872 |
| 871 view->CreateNewWindow(route_id, window_container_type); | 873 view->CreateNewWindow(route_id, window_container_type, frame_name); |
| 872 } | 874 } |
| 873 | 875 |
| 874 void RenderViewHost::CreateNewWidget(int route_id, | 876 void RenderViewHost::CreateNewWidget(int route_id, |
| 875 WebKit::WebPopupType popup_type) { | 877 WebKit::WebPopupType popup_type) { |
| 876 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); | 878 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); |
| 877 if (view) | 879 if (view) |
| 878 view->CreateNewWidget(route_id, popup_type); | 880 view->CreateNewWidget(route_id, popup_type); |
| 879 } | 881 } |
| 880 | 882 |
| 881 void RenderViewHost::OnMsgShowView(int route_id, | 883 void RenderViewHost::OnMsgShowView(int route_id, |
| (...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1894 integration_delegate->OnPageTranslated(page_id, original_lang, | 1896 integration_delegate->OnPageTranslated(page_id, original_lang, |
| 1895 translated_lang, error_type); | 1897 translated_lang, error_type); |
| 1896 } | 1898 } |
| 1897 | 1899 |
| 1898 void RenderViewHost::OnContentBlocked(ContentSettingsType type) { | 1900 void RenderViewHost::OnContentBlocked(ContentSettingsType type) { |
| 1899 RenderViewHostDelegate::Resource* resource_delegate = | 1901 RenderViewHostDelegate::Resource* resource_delegate = |
| 1900 delegate_->GetResourceDelegate(); | 1902 delegate_->GetResourceDelegate(); |
| 1901 if (resource_delegate) | 1903 if (resource_delegate) |
| 1902 resource_delegate->OnContentBlocked(type); | 1904 resource_delegate->OnContentBlocked(type); |
| 1903 } | 1905 } |
| OLD | NEW |