| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/metrics/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| 11 #include "base/metrics/histogram.h" | 11 #include "base/metrics/histogram.h" |
| 12 #include "base/metrics/user_metrics_action.h" | 12 #include "base/metrics/user_metrics_action.h" |
| 13 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 14 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 15 #include "base/strings/utf_string_conversions.h" | 15 #include "base/strings/utf_string_conversions.h" |
| 16 #include "base/values.h" | 16 #include "base/values.h" |
| 17 #include "chrome/common/channel_info.h" | 17 #include "chrome/common/channel_info.h" |
| 18 #include "chrome/common/chrome_isolated_world_ids.h" | |
| 19 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
| 20 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
| 21 #include "chrome/common/crash_keys.h" | 20 #include "chrome/common/crash_keys.h" |
| 22 #include "chrome/common/extensions/extension_metrics.h" | 21 #include "chrome/common/extensions/extension_metrics.h" |
| 23 #include "chrome/common/localized_error.h" | 22 #include "chrome/common/localized_error.h" |
| 24 #include "chrome/common/pepper_permission_util.h" | 23 #include "chrome/common/pepper_permission_util.h" |
| 25 #include "chrome/common/render_messages.h" | 24 #include "chrome/common/render_messages.h" |
| 26 #include "chrome/common/secure_origin_whitelist.h" | 25 #include "chrome/common/secure_origin_whitelist.h" |
| 27 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
| 28 #include "chrome/grit/generated_resources.h" | 27 #include "chrome/grit/generated_resources.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 52 #include "chrome/renderer/searchbox/search_bouncer.h" | 51 #include "chrome/renderer/searchbox/search_bouncer.h" |
| 53 #include "chrome/renderer/searchbox/searchbox.h" | 52 #include "chrome/renderer/searchbox/searchbox.h" |
| 54 #include "chrome/renderer/searchbox/searchbox_extension.h" | 53 #include "chrome/renderer/searchbox/searchbox_extension.h" |
| 55 #include "chrome/renderer/tts_dispatcher.h" | 54 #include "chrome/renderer/tts_dispatcher.h" |
| 56 #include "chrome/renderer/worker_content_settings_client_proxy.h" | 55 #include "chrome/renderer/worker_content_settings_client_proxy.h" |
| 57 #include "components/autofill/content/renderer/autofill_agent.h" | 56 #include "components/autofill/content/renderer/autofill_agent.h" |
| 58 #include "components/autofill/content/renderer/password_autofill_agent.h" | 57 #include "components/autofill/content/renderer/password_autofill_agent.h" |
| 59 #include "components/autofill/content/renderer/password_generation_agent.h" | 58 #include "components/autofill/content/renderer/password_generation_agent.h" |
| 60 #include "components/content_settings/core/common/content_settings_pattern.h" | 59 #include "components/content_settings/core/common/content_settings_pattern.h" |
| 61 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" | 60 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" |
| 62 #include "components/dom_distiller/content/renderer/distiller_js_render_frame_ob
server.h" | |
| 63 #include "components/dom_distiller/core/url_constants.h" | 61 #include "components/dom_distiller/core/url_constants.h" |
| 64 #include "components/nacl/renderer/ppb_nacl_private.h" | 62 #include "components/nacl/renderer/ppb_nacl_private.h" |
| 65 #include "components/nacl/renderer/ppb_nacl_private_impl.h" | 63 #include "components/nacl/renderer/ppb_nacl_private_impl.h" |
| 66 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" | 64 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" |
| 67 #include "components/password_manager/content/renderer/credential_manager_client
.h" | 65 #include "components/password_manager/content/renderer/credential_manager_client
.h" |
| 68 #include "components/pdf/renderer/pepper_pdf_host.h" | 66 #include "components/pdf/renderer/pepper_pdf_host.h" |
| 69 #include "components/plugins/renderer/mobile_youtube_plugin.h" | 67 #include "components/plugins/renderer/mobile_youtube_plugin.h" |
| 70 #include "components/signin/core/common/profile_management_switches.h" | 68 #include "components/signin/core/common/profile_management_switches.h" |
| 71 #include "components/version_info/version_info.h" | 69 #include "components/version_info/version_info.h" |
| 72 #include "components/visitedlink/renderer/visitedlink_slave.h" | 70 #include "components/visitedlink/renderer/visitedlink_slave.h" |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 new prerender::PrerenderHelper(render_frame); | 555 new prerender::PrerenderHelper(render_frame); |
| 558 } | 556 } |
| 559 } | 557 } |
| 560 | 558 |
| 561 if (render_frame->GetRenderView()->GetMainRenderFrame() == render_frame) { | 559 if (render_frame->GetRenderView()->GetMainRenderFrame() == render_frame) { |
| 562 // Only attach NetErrorHelper to the main frame, since only the main frame | 560 // Only attach NetErrorHelper to the main frame, since only the main frame |
| 563 // should get error pages. | 561 // should get error pages. |
| 564 new NetErrorHelper(render_frame); | 562 new NetErrorHelper(render_frame); |
| 565 } | 563 } |
| 566 | 564 |
| 567 // Set up a mojo service to test if this page is a distiller page. | |
| 568 new dom_distiller::DistillerJsRenderFrameObserver( | |
| 569 render_frame, chrome::ISOLATED_WORLD_ID_CHROME_INTERNAL); | |
| 570 | |
| 571 PasswordAutofillAgent* password_autofill_agent = | 565 PasswordAutofillAgent* password_autofill_agent = |
| 572 new PasswordAutofillAgent(render_frame); | 566 new PasswordAutofillAgent(render_frame); |
| 573 PasswordGenerationAgent* password_generation_agent = | 567 PasswordGenerationAgent* password_generation_agent = |
| 574 new PasswordGenerationAgent(render_frame, password_autofill_agent); | 568 new PasswordGenerationAgent(render_frame, password_autofill_agent); |
| 575 new AutofillAgent(render_frame, password_autofill_agent, | 569 new AutofillAgent(render_frame, password_autofill_agent, |
| 576 password_generation_agent); | 570 password_generation_agent); |
| 577 } | 571 } |
| 578 | 572 |
| 579 void ChromeContentRendererClient::RenderViewCreated( | 573 void ChromeContentRendererClient::RenderViewCreated( |
| 580 content::RenderView* render_view) { | 574 content::RenderView* render_view) { |
| (...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1648 context, url); | 1642 context, url); |
| 1649 #endif | 1643 #endif |
| 1650 } | 1644 } |
| 1651 | 1645 |
| 1652 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( | 1646 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( |
| 1653 const GURL& url) { | 1647 const GURL& url) { |
| 1654 #if defined(ENABLE_EXTENSIONS) | 1648 #if defined(ENABLE_EXTENSIONS) |
| 1655 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread(url); | 1649 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread(url); |
| 1656 #endif | 1650 #endif |
| 1657 } | 1651 } |
| OLD | NEW |