| 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 23 matching lines...) Expand all Loading... |
| 34 #include "chrome/grit/generated_resources.h" | 34 #include "chrome/grit/generated_resources.h" |
| 35 #include "chrome/grit/locale_settings.h" | 35 #include "chrome/grit/locale_settings.h" |
| 36 #include "chrome/grit/renderer_resources.h" | 36 #include "chrome/grit/renderer_resources.h" |
| 37 #include "chrome/renderer/app_categorizer.h" | 37 #include "chrome/renderer/app_categorizer.h" |
| 38 #include "chrome/renderer/banners/app_banner_client.h" | 38 #include "chrome/renderer/banners/app_banner_client.h" |
| 39 #include "chrome/renderer/benchmarking_extension.h" | 39 #include "chrome/renderer/benchmarking_extension.h" |
| 40 #include "chrome/renderer/chrome_render_frame_observer.h" | 40 #include "chrome/renderer/chrome_render_frame_observer.h" |
| 41 #include "chrome/renderer/chrome_render_thread_observer.h" | 41 #include "chrome/renderer/chrome_render_thread_observer.h" |
| 42 #include "chrome/renderer/chrome_render_view_observer.h" | 42 #include "chrome/renderer/chrome_render_view_observer.h" |
| 43 #include "chrome/renderer/content_settings_observer.h" | 43 #include "chrome/renderer/content_settings_observer.h" |
| 44 #include "chrome/renderer/installation_service_impl.h" |
| 44 #include "chrome/renderer/loadtimes_extension_bindings.h" | 45 #include "chrome/renderer/loadtimes_extension_bindings.h" |
| 45 #include "chrome/renderer/media/chrome_key_systems.h" | 46 #include "chrome/renderer/media/chrome_key_systems.h" |
| 46 #include "chrome/renderer/net/net_error_helper.h" | 47 #include "chrome/renderer/net/net_error_helper.h" |
| 47 #include "chrome/renderer/net_benchmarking_extension.h" | 48 #include "chrome/renderer/net_benchmarking_extension.h" |
| 48 #include "chrome/renderer/page_load_histograms.h" | 49 #include "chrome/renderer/page_load_histograms.h" |
| 49 #include "chrome/renderer/page_load_metrics/metrics_render_frame_observer.h" | 50 #include "chrome/renderer/page_load_metrics/metrics_render_frame_observer.h" |
| 50 #include "chrome/renderer/pepper/pepper_helper.h" | 51 #include "chrome/renderer/pepper/pepper_helper.h" |
| 51 #include "chrome/renderer/plugins/non_loadable_plugin_placeholder.h" | 52 #include "chrome/renderer/plugins/non_loadable_plugin_placeholder.h" |
| 52 #include "chrome/renderer/plugins/plugin_preroller.h" | 53 #include "chrome/renderer/plugins/plugin_preroller.h" |
| 53 #include "chrome/renderer/plugins/plugin_uma.h" | 54 #include "chrome/renderer/plugins/plugin_uma.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 #include "content/public/renderer/render_frame.h" | 91 #include "content/public/renderer/render_frame.h" |
| 91 #include "content/public/renderer/render_thread.h" | 92 #include "content/public/renderer/render_thread.h" |
| 92 #include "content/public/renderer/render_view.h" | 93 #include "content/public/renderer/render_view.h" |
| 93 #include "content/public/renderer/render_view_visitor.h" | 94 #include "content/public/renderer/render_view_visitor.h" |
| 94 #include "extensions/common/constants.h" | 95 #include "extensions/common/constants.h" |
| 95 #include "ipc/ipc_sync_channel.h" | 96 #include "ipc/ipc_sync_channel.h" |
| 96 #include "net/base/net_errors.h" | 97 #include "net/base/net_errors.h" |
| 97 #include "ppapi/c/private/ppb_pdf.h" | 98 #include "ppapi/c/private/ppb_pdf.h" |
| 98 #include "ppapi/shared_impl/ppapi_switches.h" | 99 #include "ppapi/shared_impl/ppapi_switches.h" |
| 99 #include "services/shell/public/cpp/interface_provider.h" | 100 #include "services/shell/public/cpp/interface_provider.h" |
| 101 #include "services/shell/public/cpp/interface_registry.h" |
| 100 #include "third_party/WebKit/public/platform/URLConversion.h" | 102 #include "third_party/WebKit/public/platform/URLConversion.h" |
| 101 #include "third_party/WebKit/public/platform/WebCachePolicy.h" | 103 #include "third_party/WebKit/public/platform/WebCachePolicy.h" |
| 102 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" | 104 #include "third_party/WebKit/public/platform/WebSecurityOrigin.h" |
| 103 #include "third_party/WebKit/public/platform/WebURL.h" | 105 #include "third_party/WebKit/public/platform/WebURL.h" |
| 104 #include "third_party/WebKit/public/platform/WebURLError.h" | 106 #include "third_party/WebKit/public/platform/WebURLError.h" |
| 105 #include "third_party/WebKit/public/platform/WebURLRequest.h" | 107 #include "third_party/WebKit/public/platform/WebURLRequest.h" |
| 106 #include "third_party/WebKit/public/platform/WebURLResponse.h" | 108 #include "third_party/WebKit/public/platform/WebURLResponse.h" |
| 107 #include "third_party/WebKit/public/web/WebCache.h" | 109 #include "third_party/WebKit/public/web/WebCache.h" |
| 108 #include "third_party/WebKit/public/web/WebDataSource.h" | 110 #include "third_party/WebKit/public/web/WebDataSource.h" |
| 109 #include "third_party/WebKit/public/web/WebDocument.h" | 111 #include "third_party/WebKit/public/web/WebDocument.h" |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 if (prerender::PrerenderHelper::IsPrerendering( | 485 if (prerender::PrerenderHelper::IsPrerendering( |
| 484 render_frame->GetRenderView()->GetMainRenderFrame())) { | 486 render_frame->GetRenderView()->GetMainRenderFrame())) { |
| 485 new prerender::PrerenderHelper(render_frame); | 487 new prerender::PrerenderHelper(render_frame); |
| 486 } | 488 } |
| 487 } | 489 } |
| 488 | 490 |
| 489 // Set up a mojo service to test if this page is a distiller page. | 491 // Set up a mojo service to test if this page is a distiller page. |
| 490 new dom_distiller::DistillerJsRenderFrameObserver( | 492 new dom_distiller::DistillerJsRenderFrameObserver( |
| 491 render_frame, chrome::ISOLATED_WORLD_ID_CHROME_INTERNAL); | 493 render_frame, chrome::ISOLATED_WORLD_ID_CHROME_INTERNAL); |
| 492 | 494 |
| 495 // Create a mojo service for receiving installation events. |
| 496 render_frame->GetInterfaceRegistry()->AddInterface( |
| 497 base::Bind(&InstallationServiceImpl::Create, render_frame)); |
| 498 |
| 493 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 499 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 494 if (command_line->HasSwitch(switches::kEnableDistillabilityService)) { | 500 if (command_line->HasSwitch(switches::kEnableDistillabilityService)) { |
| 495 // Create DistillabilityAgent to send distillability updates to | 501 // Create DistillabilityAgent to send distillability updates to |
| 496 // DistillabilityDriver in the browser process. | 502 // DistillabilityDriver in the browser process. |
| 497 new dom_distiller::DistillabilityAgent(render_frame); | 503 new dom_distiller::DistillabilityAgent(render_frame); |
| 498 } | 504 } |
| 499 | 505 |
| 500 // Set up a mojo service to test if this page is a contextual search page. | 506 // Set up a mojo service to test if this page is a contextual search page. |
| 501 new contextual_search::OverlayJsRenderFrameObserver(render_frame); | 507 new contextual_search::OverlayJsRenderFrameObserver(render_frame); |
| 502 | 508 |
| (...skipping 967 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 | 1476 |
| 1471 url::Replacements<char> r; | 1477 url::Replacements<char> r; |
| 1472 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1478 r.SetPath(path.c_str(), url::Component(0, path.length())); |
| 1473 | 1479 |
| 1474 if (result == internal::NUM_PLUGIN_ERROR) | 1480 if (result == internal::NUM_PLUGIN_ERROR) |
| 1475 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1481 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
| 1476 | 1482 |
| 1477 RecordYouTubeRewriteUMA(result); | 1483 RecordYouTubeRewriteUMA(result); |
| 1478 return corrected_url.ReplaceComponents(r); | 1484 return corrected_url.ReplaceComponents(r); |
| 1479 } | 1485 } |
| OLD | NEW |