| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 1086 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1097 bool should_fork = ChromeExtensionsRendererClient::ShouldFork( | 1097 bool should_fork = ChromeExtensionsRendererClient::ShouldFork( |
| 1098 frame, url, is_initial_navigation, is_server_redirect, send_referrer); | 1098 frame, url, is_initial_navigation, is_server_redirect, send_referrer); |
| 1099 if (should_fork) | 1099 if (should_fork) |
| 1100 return true; | 1100 return true; |
| 1101 #endif // BUILDFLAG(ENABLE_EXTENSIONS) | 1101 #endif // BUILDFLAG(ENABLE_EXTENSIONS) |
| 1102 | 1102 |
| 1103 return false; | 1103 return false; |
| 1104 } | 1104 } |
| 1105 | 1105 |
| 1106 bool ChromeContentRendererClient::WillSendRequest( | 1106 bool ChromeContentRendererClient::WillSendRequest( |
| 1107 WebFrame* frame, | 1107 WebLocalFrame* frame, |
| 1108 ui::PageTransition transition_type, | 1108 ui::PageTransition transition_type, |
| 1109 const blink::WebURL& url, | 1109 const blink::WebURL& url, |
| 1110 GURL* new_url) { | 1110 GURL* new_url) { |
| 1111 // Check whether the request should be allowed. If not allowed, we reset the | 1111 // Check whether the request should be allowed. If not allowed, we reset the |
| 1112 // URL to something invalid to prevent the request and cause an error. | 1112 // URL to something invalid to prevent the request and cause an error. |
| 1113 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1113 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 1114 if (ChromeExtensionsRendererClient::GetInstance()->WillSendRequest( | 1114 if (ChromeExtensionsRendererClient::GetInstance()->WillSendRequest( |
| 1115 frame, transition_type, url, new_url)) { | 1115 frame, transition_type, url, new_url)) { |
| 1116 return true; | 1116 return true; |
| 1117 } | 1117 } |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 | 1467 |
| 1468 url::Replacements<char> r; | 1468 url::Replacements<char> r; |
| 1469 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1469 r.SetPath(path.c_str(), url::Component(0, path.length())); |
| 1470 | 1470 |
| 1471 if (result == internal::NUM_PLUGIN_ERROR) | 1471 if (result == internal::NUM_PLUGIN_ERROR) |
| 1472 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1472 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
| 1473 | 1473 |
| 1474 RecordYouTubeRewriteUMA(result); | 1474 RecordYouTubeRewriteUMA(result); |
| 1475 return corrected_url.ReplaceComponents(r); | 1475 return corrected_url.ReplaceComponents(r); |
| 1476 } | 1476 } |
| OLD | NEW |