| 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 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInstantProcess)) | 830 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInstantProcess)) |
| 831 return true; | 831 return true; |
| 832 | 832 |
| 833 // For now, we skip the rest for POST submissions. This is because | 833 // For now, we skip the rest for POST submissions. This is because |
| 834 // http://crbug.com/101395 is more likely to cause compatibility issues | 834 // http://crbug.com/101395 is more likely to cause compatibility issues |
| 835 // with hosted apps and extensions than WebUI pages. We will remove this | 835 // with hosted apps and extensions than WebUI pages. We will remove this |
| 836 // check when cross-process POST submissions are supported. | 836 // check when cross-process POST submissions are supported. |
| 837 if (http_method != "GET") | 837 if (http_method != "GET") |
| 838 return false; | 838 return false; |
| 839 | 839 |
| 840 // If this is the Signin process, fork all navigations originating from the |
| 841 // renderer. The destination page will then be bucketed back to this Signin |
| 842 // process if it is a Signin url, or to another process if not. |
| 843 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSigninProcess)) { |
| 844 // We never want to allow non-signin pages to fork-on-POST to a |
| 845 // signin-related action URL. We'll need to handle this carefully once |
| 846 // http://crbug.com/101395 is fixed. The CHECK ensures we don't forget. |
| 847 CHECK_NE(http_method, "POST"); |
| 848 return true; |
| 849 } |
| 850 |
| 840 // If |url| matches one of the prerendered URLs, stop this navigation and try | 851 // If |url| matches one of the prerendered URLs, stop this navigation and try |
| 841 // to swap in the prerendered page on the browser process. If the prerendered | 852 // to swap in the prerendered page on the browser process. If the prerendered |
| 842 // page no longer exists by the time the OpenURL IPC is handled, a normal | 853 // page no longer exists by the time the OpenURL IPC is handled, a normal |
| 843 // navigation is attempted. | 854 // navigation is attempted. |
| 844 if (prerender_dispatcher_.get() && prerender_dispatcher_->IsPrerenderURL(url)) | 855 if (prerender_dispatcher_.get() && prerender_dispatcher_->IsPrerenderURL(url)) |
| 845 return true; | 856 return true; |
| 846 | 857 |
| 847 const ExtensionSet* extensions = extension_dispatcher_->extensions(); | 858 const ExtensionSet* extensions = extension_dispatcher_->extensions(); |
| 848 | 859 |
| 849 // Determine if the new URL is an extension (excluding bookmark apps). | 860 // Determine if the new URL is an extension (excluding bookmark apps). |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1098 if (container->element().shadowHost().tagName().equals( | 1109 if (container->element().shadowHost().tagName().equals( |
| 1099 WebKit::WebString::fromUTF8(kWebViewTagName))) { | 1110 WebKit::WebString::fromUTF8(kWebViewTagName))) { |
| 1100 return true; | 1111 return true; |
| 1101 } else { | 1112 } else { |
| 1102 return CommandLine::ForCurrentProcess()->HasSwitch( | 1113 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 1103 switches::kEnableBrowserPluginForAllViewTypes); | 1114 switches::kEnableBrowserPluginForAllViewTypes); |
| 1104 } | 1115 } |
| 1105 } | 1116 } |
| 1106 | 1117 |
| 1107 } // namespace chrome | 1118 } // namespace chrome |
| OLD | NEW |