| 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 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 837 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInstantProcess)) | 837 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInstantProcess)) |
| 838 return true; | 838 return true; |
| 839 | 839 |
| 840 // For now, we skip the rest for POST submissions. This is because | 840 // For now, we skip the rest for POST submissions. This is because |
| 841 // http://crbug.com/101395 is more likely to cause compatibility issues | 841 // http://crbug.com/101395 is more likely to cause compatibility issues |
| 842 // with hosted apps and extensions than WebUI pages. We will remove this | 842 // with hosted apps and extensions than WebUI pages. We will remove this |
| 843 // check when cross-process POST submissions are supported. | 843 // check when cross-process POST submissions are supported. |
| 844 if (http_method != "GET") | 844 if (http_method != "GET") |
| 845 return false; | 845 return false; |
| 846 | 846 |
| 847 // If this is the Signin process, fork all navigations originating from the |
| 848 // renderer. The destination page will then be bucketed back to this Signin |
| 849 // process if it is a Signin url, or to another process if not. |
| 850 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSigninProcess)) { |
| 851 // We explicitly do this *after* checking that http_method is not POST, |
| 852 // because we don't want to allow non-signin pages to fork-on-POST to a |
| 853 // signin-related action URL. |
| 854 CHECK_NE(http_method, "POST"); |
| 855 return true; |
| 856 } |
| 857 |
| 847 // If |url| matches one of the prerendered URLs, stop this navigation and try | 858 // If |url| matches one of the prerendered URLs, stop this navigation and try |
| 848 // to swap in the prerendered page on the browser process. If the prerendered | 859 // to swap in the prerendered page on the browser process. If the prerendered |
| 849 // page no longer exists by the time the OpenURL IPC is handled, a normal | 860 // page no longer exists by the time the OpenURL IPC is handled, a normal |
| 850 // navigation is attempted. | 861 // navigation is attempted. |
| 851 if (prerender_dispatcher_.get() && prerender_dispatcher_->IsPrerenderURL(url)) | 862 if (prerender_dispatcher_.get() && prerender_dispatcher_->IsPrerenderURL(url)) |
| 852 return true; | 863 return true; |
| 853 | 864 |
| 854 const ExtensionSet* extensions = extension_dispatcher_->extensions(); | 865 const ExtensionSet* extensions = extension_dispatcher_->extensions(); |
| 855 | 866 |
| 856 // Determine if the new URL is an extension (excluding bookmark apps). | 867 // Determine if the new URL is an extension (excluding bookmark apps). |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1079 } | 1090 } |
| 1080 | 1091 |
| 1081 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( | 1092 void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories( |
| 1082 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { | 1093 webkit::ppapi::PpapiInterfaceFactoryManager* factory_manager) { |
| 1083 #if defined(ENABLE_PLUGINS) | 1094 #if defined(ENABLE_PLUGINS) |
| 1084 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); | 1095 factory_manager->RegisterFactory(ChromePPAPIInterfaceFactory); |
| 1085 #endif | 1096 #endif |
| 1086 } | 1097 } |
| 1087 | 1098 |
| 1088 } // namespace chrome | 1099 } // namespace chrome |
| OLD | NEW |