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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 #include "chrome/renderer/tts_dispatcher.h" | 62 #include "chrome/renderer/tts_dispatcher.h" |
63 #include "chrome/renderer/worker_content_settings_client_proxy.h" | 63 #include "chrome/renderer/worker_content_settings_client_proxy.h" |
64 #include "components/autofill/content/renderer/autofill_agent.h" | 64 #include "components/autofill/content/renderer/autofill_agent.h" |
65 #include "components/autofill/content/renderer/password_autofill_agent.h" | 65 #include "components/autofill/content/renderer/password_autofill_agent.h" |
66 #include "components/autofill/content/renderer/password_generation_agent.h" | 66 #include "components/autofill/content/renderer/password_generation_agent.h" |
67 #include "components/content_settings/core/common/content_settings_pattern.h" | 67 #include "components/content_settings/core/common/content_settings_pattern.h" |
68 #include "components/contextual_search/renderer/overlay_js_render_frame_observer
.h" | 68 #include "components/contextual_search/renderer/overlay_js_render_frame_observer
.h" |
69 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" | 69 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" |
70 #include "components/dom_distiller/content/renderer/distillability_agent.h" | 70 #include "components/dom_distiller/content/renderer/distillability_agent.h" |
71 #include "components/dom_distiller/content/renderer/distiller_js_render_frame_ob
server.h" | 71 #include "components/dom_distiller/content/renderer/distiller_js_render_frame_ob
server.h" |
| 72 #include "components/dom_distiller/core/dom_distiller_switches.h" |
72 #include "components/dom_distiller/core/url_constants.h" | 73 #include "components/dom_distiller/core/url_constants.h" |
73 #include "components/error_page/common/localized_error.h" | 74 #include "components/error_page/common/localized_error.h" |
74 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" | 75 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" |
75 #include "components/password_manager/content/renderer/credential_manager_client
.h" | 76 #include "components/password_manager/content/renderer/credential_manager_client
.h" |
76 #include "components/pdf/renderer/pepper_pdf_host.h" | 77 #include "components/pdf/renderer/pepper_pdf_host.h" |
77 #include "components/plugins/renderer/mobile_youtube_plugin.h" | 78 #include "components/plugins/renderer/mobile_youtube_plugin.h" |
78 #include "components/signin/core/common/profile_management_switches.h" | 79 #include "components/signin/core/common/profile_management_switches.h" |
79 #include "components/startup_metric_utils/common/startup_metric.mojom.h" | 80 #include "components/startup_metric_utils/common/startup_metric.mojom.h" |
80 #include "components/subresource_filter/content/renderer/ruleset_dealer.h" | 81 #include "components/subresource_filter/content/renderer/ruleset_dealer.h" |
81 #include "components/subresource_filter/content/renderer/subresource_filter_agen
t.h" | 82 #include "components/subresource_filter/content/renderer/subresource_filter_agen
t.h" |
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 if (prerender::PrerenderHelper::IsPrerendering( | 504 if (prerender::PrerenderHelper::IsPrerendering( |
504 render_frame->GetRenderView()->GetMainRenderFrame())) { | 505 render_frame->GetRenderView()->GetMainRenderFrame())) { |
505 new prerender::PrerenderHelper(render_frame); | 506 new prerender::PrerenderHelper(render_frame); |
506 } | 507 } |
507 } | 508 } |
508 | 509 |
509 // Set up a mojo service to test if this page is a distiller page. | 510 // Set up a mojo service to test if this page is a distiller page. |
510 new dom_distiller::DistillerJsRenderFrameObserver( | 511 new dom_distiller::DistillerJsRenderFrameObserver( |
511 render_frame, chrome::ISOLATED_WORLD_ID_CHROME_INTERNAL); | 512 render_frame, chrome::ISOLATED_WORLD_ID_CHROME_INTERNAL); |
512 | 513 |
513 // Create DistillabilityAgent to send distillability updates to | 514 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
514 // DistillabilityDriver in the browser process. | 515 if (command_line->HasSwitch(switches::kEnableDistillabilityService)) { |
515 new dom_distiller::DistillabilityAgent(render_frame); | 516 // Create DistillabilityAgent to send distillability updates to |
| 517 // DistillabilityDriver in the browser process. |
| 518 new dom_distiller::DistillabilityAgent(render_frame); |
| 519 } |
516 | 520 |
517 // Set up a mojo service to test if this page is a contextual search page. | 521 // Set up a mojo service to test if this page is a contextual search page. |
518 new contextual_search::OverlayJsRenderFrameObserver(render_frame); | 522 new contextual_search::OverlayJsRenderFrameObserver(render_frame); |
519 | 523 |
520 PasswordAutofillAgent* password_autofill_agent = | 524 PasswordAutofillAgent* password_autofill_agent = |
521 new PasswordAutofillAgent(render_frame); | 525 new PasswordAutofillAgent(render_frame); |
522 PasswordGenerationAgent* password_generation_agent = | 526 PasswordGenerationAgent* password_generation_agent = |
523 new PasswordGenerationAgent(render_frame, password_autofill_agent); | 527 new PasswordGenerationAgent(render_frame, password_autofill_agent); |
524 new AutofillAgent(render_frame, password_autofill_agent, | 528 new AutofillAgent(render_frame, password_autofill_agent, |
525 password_generation_agent); | 529 password_generation_agent); |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1479 | 1483 |
1480 url::Replacements<char> r; | 1484 url::Replacements<char> r; |
1481 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1485 r.SetPath(path.c_str(), url::Component(0, path.length())); |
1482 | 1486 |
1483 if (result == internal::NUM_PLUGIN_ERROR) | 1487 if (result == internal::NUM_PLUGIN_ERROR) |
1484 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1488 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
1485 | 1489 |
1486 RecordYouTubeRewriteUMA(result); | 1490 RecordYouTubeRewriteUMA(result); |
1487 return corrected_url.ReplaceComponents(r); | 1491 return corrected_url.ReplaceComponents(r); |
1488 } | 1492 } |
OLD | NEW |