| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 1255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1266 return true; | 1266 return true; |
| 1267 } | 1267 } |
| 1268 | 1268 |
| 1269 // For now, we skip the rest for POST submissions. This is because | 1269 // For now, we skip the rest for POST submissions. This is because |
| 1270 // http://crbug.com/101395 is more likely to cause compatibility issues | 1270 // http://crbug.com/101395 is more likely to cause compatibility issues |
| 1271 // with hosted apps and extensions than WebUI pages. We will remove this | 1271 // with hosted apps and extensions than WebUI pages. We will remove this |
| 1272 // check when cross-process POST submissions are supported. | 1272 // check when cross-process POST submissions are supported. |
| 1273 if (http_method != "GET") | 1273 if (http_method != "GET") |
| 1274 return false; | 1274 return false; |
| 1275 | 1275 |
| 1276 // If this is the Signin process, fork all navigations originating from the | |
| 1277 // renderer. The destination page will then be bucketed back to this Signin | |
| 1278 // process if it is a Signin url, or to another process if not. | |
| 1279 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | |
| 1280 switches::kSigninProcess)) { | |
| 1281 // We never want to allow non-signin pages to fork-on-POST to a | |
| 1282 // signin-related action URL. We'll need to handle this carefully once | |
| 1283 // http://crbug.com/101395 is fixed. The CHECK ensures we don't forget. | |
| 1284 CHECK_NE(http_method, "POST"); | |
| 1285 return true; | |
| 1286 } | |
| 1287 | |
| 1288 // If |url| matches one of the prerendered URLs, stop this navigation and try | 1276 // If |url| matches one of the prerendered URLs, stop this navigation and try |
| 1289 // to swap in the prerendered page on the browser process. If the prerendered | 1277 // to swap in the prerendered page on the browser process. If the prerendered |
| 1290 // page no longer exists by the time the OpenURL IPC is handled, a normal | 1278 // page no longer exists by the time the OpenURL IPC is handled, a normal |
| 1291 // navigation is attempted. | 1279 // navigation is attempted. |
| 1292 if (prerender_dispatcher_.get() && | 1280 if (prerender_dispatcher_.get() && |
| 1293 prerender_dispatcher_->IsPrerenderURL(url)) { | 1281 prerender_dispatcher_->IsPrerenderURL(url)) { |
| 1294 *send_referrer = true; | 1282 *send_referrer = true; |
| 1295 return true; | 1283 return true; |
| 1296 } | 1284 } |
| 1297 | 1285 |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1652 if (mime_type == content::kBrowserPluginMimeType) { | 1640 if (mime_type == content::kBrowserPluginMimeType) { |
| 1653 return new extensions::ExtensionsGuestViewContainer(render_frame); | 1641 return new extensions::ExtensionsGuestViewContainer(render_frame); |
| 1654 } else { | 1642 } else { |
| 1655 return new extensions::MimeHandlerViewContainer( | 1643 return new extensions::MimeHandlerViewContainer( |
| 1656 render_frame, mime_type, original_url); | 1644 render_frame, mime_type, original_url); |
| 1657 } | 1645 } |
| 1658 #else | 1646 #else |
| 1659 return NULL; | 1647 return NULL; |
| 1660 #endif | 1648 #endif |
| 1661 } | 1649 } |
| OLD | NEW |