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 "chrome/renderer/chrome_content_renderer_client.h" | 5 #include "chrome/renderer/chrome_content_renderer_client.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 thread->GetChannel()->set_outgoing_message_filter(LoadExternalIPCFuzzer()); | 266 thread->GetChannel()->set_outgoing_message_filter(LoadExternalIPCFuzzer()); |
267 } | 267 } |
268 // chrome:, chrome-search:, chrome-devtools:, and chrome-internal: pages | 268 // chrome:, chrome-search:, chrome-devtools:, and chrome-internal: pages |
269 // should not be accessible by normal content, and should also be unable to | 269 // should not be accessible by normal content, and should also be unable to |
270 // script anything but themselves (to help limit the damage that a corrupt | 270 // script anything but themselves (to help limit the damage that a corrupt |
271 // page could cause). | 271 // page could cause). |
272 WebString chrome_ui_scheme(ASCIIToUTF16(chrome::kChromeUIScheme)); | 272 WebString chrome_ui_scheme(ASCIIToUTF16(chrome::kChromeUIScheme)); |
273 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_ui_scheme); | 273 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_ui_scheme); |
274 | 274 |
275 WebString chrome_search_scheme(ASCIIToUTF16(chrome::kChromeSearchScheme)); | 275 WebString chrome_search_scheme(ASCIIToUTF16(chrome::kChromeSearchScheme)); |
276 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_search_scheme); | 276 // The Instant process can only display the content but not read it. Other |
| 277 // processes can't display it or read it. |
| 278 if (!command_line->HasSwitch(switches::kInstantProcess)) |
| 279 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(chrome_search_scheme); |
277 | 280 |
278 WebString dev_tools_scheme(ASCIIToUTF16(chrome::kChromeDevToolsScheme)); | 281 WebString dev_tools_scheme(ASCIIToUTF16(chrome::kChromeDevToolsScheme)); |
279 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(dev_tools_scheme); | 282 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(dev_tools_scheme); |
280 | 283 |
281 WebString internal_scheme(ASCIIToUTF16(chrome::kChromeInternalScheme)); | 284 WebString internal_scheme(ASCIIToUTF16(chrome::kChromeInternalScheme)); |
282 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(internal_scheme); | 285 WebSecurityPolicy::registerURLSchemeAsDisplayIsolated(internal_scheme); |
283 | 286 |
284 #if defined(OS_CHROMEOS) | 287 #if defined(OS_CHROMEOS) |
285 WebString drive_scheme(ASCIIToUTF16(chrome::kDriveScheme)); | 288 WebString drive_scheme(ASCIIToUTF16(chrome::kDriveScheme)); |
286 WebSecurityPolicy::registerURLSchemeAsLocal(drive_scheme); | 289 WebSecurityPolicy::registerURLSchemeAsLocal(drive_scheme); |
(...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 | 1166 |
1164 if (container->element().shadowHost().isNull()) | 1167 if (container->element().shadowHost().isNull()) |
1165 return false; | 1168 return false; |
1166 | 1169 |
1167 WebString tag_name = container->element().shadowHost().tagName(); | 1170 WebString tag_name = container->element().shadowHost().tagName(); |
1168 return tag_name.equals(WebString::fromUTF8(kWebViewTagName)) || | 1171 return tag_name.equals(WebString::fromUTF8(kWebViewTagName)) || |
1169 tag_name.equals(WebString::fromUTF8(kAdViewTagName)); | 1172 tag_name.equals(WebString::fromUTF8(kAdViewTagName)); |
1170 } | 1173 } |
1171 | 1174 |
1172 } // namespace chrome | 1175 } // namespace chrome |
OLD | NEW |