| 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 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 404 WebSecurityPolicy::registerURLSchemeAsLocal( | 404 WebSecurityPolicy::registerURLSchemeAsLocal( |
| 405 WebString::fromUTF8(url::kContentScheme)); | 405 WebString::fromUTF8(url::kContentScheme)); |
| 406 #endif | 406 #endif |
| 407 | 407 |
| 408 // chrome-search: pages should not be accessible by bookmarklets | 408 // chrome-search: pages should not be accessible by bookmarklets |
| 409 // or javascript: URLs typed in the omnibox. | 409 // or javascript: URLs typed in the omnibox. |
| 410 WebSecurityPolicy::registerURLSchemeAsNotAllowingJavascriptURLs( | 410 WebSecurityPolicy::registerURLSchemeAsNotAllowingJavascriptURLs( |
| 411 chrome_search_scheme); | 411 chrome_search_scheme); |
| 412 | 412 |
| 413 // chrome-search: resources shouldn't trigger insecure content warnings. Note | 413 // chrome-search: resources shouldn't trigger insecure content warnings. Note |
| 414 // that chrome-extension: and chrome-extension-resource: schemes are taken | 414 // that the chrome-extension: scheme is registered by extensions::Dispatcher. |
| 415 // care of in extensions::Dispatcher. | |
| 416 WebSecurityPolicy::registerURLSchemeAsSecure(chrome_search_scheme); | 415 WebSecurityPolicy::registerURLSchemeAsSecure(chrome_search_scheme); |
| 417 | 416 |
| 418 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 417 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 419 pdf_print_client_.reset(new ChromePDFPrintClient()); | 418 pdf_print_client_.reset(new ChromePDFPrintClient()); |
| 420 pdf::PepperPDFHost::SetPrintClient(pdf_print_client_.get()); | 419 pdf::PepperPDFHost::SetPrintClient(pdf_print_client_.get()); |
| 421 #endif | 420 #endif |
| 422 | 421 |
| 423 std::set<GURL> origins; | 422 std::set<GURL> origins; |
| 424 GetSecureOriginWhitelist(&origins); | 423 GetSecureOriginWhitelist(&origins); |
| 425 for (const GURL& origin : origins) { | 424 for (const GURL& origin : origins) { |
| (...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 | 1466 |
| 1468 url::Replacements<char> r; | 1467 url::Replacements<char> r; |
| 1469 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1468 r.SetPath(path.c_str(), url::Component(0, path.length())); |
| 1470 | 1469 |
| 1471 if (result == internal::NUM_PLUGIN_ERROR) | 1470 if (result == internal::NUM_PLUGIN_ERROR) |
| 1472 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1471 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
| 1473 | 1472 |
| 1474 RecordYouTubeRewriteUMA(result); | 1473 RecordYouTubeRewriteUMA(result); |
| 1475 return corrected_url.ReplaceComponents(r); | 1474 return corrected_url.ReplaceComponents(r); |
| 1476 } | 1475 } |
| OLD | NEW |