Chromium Code Reviews| 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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 161 ChildProcessSecurityPolicy::GetInstance()->GrantExtensionBindings( | 161 ChildProcessSecurityPolicy::GetInstance()->GrantExtensionBindings( |
| 162 process()->id()); | 162 process()->id()); |
| 163 | 163 |
| 164 // Extensions may have permission to access chrome:// URLs. | 164 // Extensions may have permission to access chrome:// URLs. |
| 165 ChildProcessSecurityPolicy::GetInstance()->GrantScheme( | 165 ChildProcessSecurityPolicy::GetInstance()->GrantScheme( |
| 166 process()->id(), chrome::kChromeUIScheme); | 166 process()->id(), chrome::kChromeUIScheme); |
| 167 } | 167 } |
| 168 | 168 |
| 169 renderer_initialized_ = true; | 169 renderer_initialized_ = true; |
| 170 | 170 |
| 171 // Force local storage to be enabled for extensions. This is so that we can | |
| 172 // enable extensions by default before databases, if necessary. | |
| 173 // TODO(aa): This should be removed when local storage and databases are | |
| 174 // enabled by default (bugs 4359 and 4360). | |
| 175 WebPreferences webkit_prefs = delegate_->GetWebkitPrefs(); | |
| 176 if (delegate_->GetURL().SchemeIs(chrome::kExtensionScheme)) { | |
| 177 webkit_prefs.local_storage_enabled = true; | |
| 178 webkit_prefs.databases_enabled = true; | |
|
Aaron Boodman
2011/01/18 23:00:53
Does this mean that these preferences will always
Alex Nicolaou
2011/01/19 00:43:37
I wouldn't know, I was going based on your TODO ab
| |
| 179 } | |
| 180 | |
| 181 ViewMsg_New_Params params; | 171 ViewMsg_New_Params params; |
| 182 params.parent_window = GetNativeViewId(); | 172 params.parent_window = GetNativeViewId(); |
| 183 params.renderer_preferences = | 173 params.renderer_preferences = |
| 184 delegate_->GetRendererPrefs(process()->profile()); | 174 delegate_->GetRendererPrefs(process()->profile()); |
| 185 params.web_preferences = webkit_prefs; | 175 params.web_preferences = delegate_->GetWebkitPrefs(); |
| 186 params.view_id = routing_id(); | 176 params.view_id = routing_id(); |
| 187 params.session_storage_namespace_id = session_storage_namespace_->id(); | 177 params.session_storage_namespace_id = session_storage_namespace_->id(); |
| 188 params.frame_name = frame_name; | 178 params.frame_name = frame_name; |
| 189 Send(new ViewMsg_New(params)); | 179 Send(new ViewMsg_New(params)); |
| 190 | 180 |
| 191 // Set the alternate error page, which is profile specific, in the renderer. | 181 // Set the alternate error page, which is profile specific, in the renderer. |
| 192 GURL url = delegate_->GetAlternateErrorPageURL(); | 182 GURL url = delegate_->GetAlternateErrorPageURL(); |
| 193 SetAlternateErrorPageURL(url); | 183 SetAlternateErrorPageURL(url); |
| 194 | 184 |
| 195 // If it's enabled, tell the renderer to set up the Javascript bindings for | 185 // If it's enabled, tell the renderer to set up the Javascript bindings for |
| (...skipping 1824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2020 if (printer_query.get()) { | 2010 if (printer_query.get()) { |
| 2021 BrowserThread::PostTask( | 2011 BrowserThread::PostTask( |
| 2022 BrowserThread::IO, FROM_HERE, | 2012 BrowserThread::IO, FROM_HERE, |
| 2023 NewRunnableMethod(printer_query.get(), | 2013 NewRunnableMethod(printer_query.get(), |
| 2024 &printing::PrinterQuery::StopWorker)); | 2014 &printing::PrinterQuery::StopWorker)); |
| 2025 } | 2015 } |
| 2026 | 2016 |
| 2027 // Send the printingDone msg for now. | 2017 // Send the printingDone msg for now. |
| 2028 Send(new ViewMsg_PrintingDone(routing_id(), params.document_cookie, true)); | 2018 Send(new ViewMsg_PrintingDone(routing_id(), params.document_cookie, true)); |
| 2029 } | 2019 } |
| OLD | NEW |