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/chrome_isolated_world_ids.h" |
17 #include "chrome/common/chrome_paths.h" | 18 #include "chrome/common/chrome_paths.h" |
18 #include "chrome/common/chrome_switches.h" | 19 #include "chrome/common/chrome_switches.h" |
19 #include "chrome/common/chrome_version_info.h" | 20 #include "chrome/common/chrome_version_info.h" |
20 #include "chrome/common/crash_keys.h" | 21 #include "chrome/common/crash_keys.h" |
21 #include "chrome/common/extensions/extension_metrics.h" | 22 #include "chrome/common/extensions/extension_metrics.h" |
22 #include "chrome/common/localized_error.h" | 23 #include "chrome/common/localized_error.h" |
23 #include "chrome/common/pepper_permission_util.h" | 24 #include "chrome/common/pepper_permission_util.h" |
24 #include "chrome/common/render_messages.h" | 25 #include "chrome/common/render_messages.h" |
25 #include "chrome/common/secure_origin_whitelist.h" | 26 #include "chrome/common/secure_origin_whitelist.h" |
26 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
(...skipping 26 matching lines...) Expand all Loading... |
53 #include "chrome/renderer/searchbox/search_bouncer.h" | 54 #include "chrome/renderer/searchbox/search_bouncer.h" |
54 #include "chrome/renderer/searchbox/searchbox.h" | 55 #include "chrome/renderer/searchbox/searchbox.h" |
55 #include "chrome/renderer/searchbox/searchbox_extension.h" | 56 #include "chrome/renderer/searchbox/searchbox_extension.h" |
56 #include "chrome/renderer/tts_dispatcher.h" | 57 #include "chrome/renderer/tts_dispatcher.h" |
57 #include "chrome/renderer/worker_content_settings_client_proxy.h" | 58 #include "chrome/renderer/worker_content_settings_client_proxy.h" |
58 #include "components/autofill/content/renderer/autofill_agent.h" | 59 #include "components/autofill/content/renderer/autofill_agent.h" |
59 #include "components/autofill/content/renderer/password_autofill_agent.h" | 60 #include "components/autofill/content/renderer/password_autofill_agent.h" |
60 #include "components/autofill/content/renderer/password_generation_agent.h" | 61 #include "components/autofill/content/renderer/password_generation_agent.h" |
61 #include "components/content_settings/core/common/content_settings_pattern.h" | 62 #include "components/content_settings/core/common/content_settings_pattern.h" |
62 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" | 63 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_heade
rs.h" |
| 64 #include "components/dom_distiller/content/renderer/distiller_js_render_frame_ob
server.h" |
63 #include "components/dom_distiller/core/url_constants.h" | 65 #include "components/dom_distiller/core/url_constants.h" |
64 #include "components/nacl/renderer/ppb_nacl_private.h" | 66 #include "components/nacl/renderer/ppb_nacl_private.h" |
65 #include "components/nacl/renderer/ppb_nacl_private_impl.h" | 67 #include "components/nacl/renderer/ppb_nacl_private_impl.h" |
66 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" | 68 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" |
67 #include "components/password_manager/content/renderer/credential_manager_client
.h" | 69 #include "components/password_manager/content/renderer/credential_manager_client
.h" |
68 #include "components/pdf/renderer/pepper_pdf_host.h" | 70 #include "components/pdf/renderer/pepper_pdf_host.h" |
69 #include "components/plugins/renderer/mobile_youtube_plugin.h" | 71 #include "components/plugins/renderer/mobile_youtube_plugin.h" |
70 #include "components/signin/core/common/profile_management_switches.h" | 72 #include "components/signin/core/common/profile_management_switches.h" |
71 #include "components/visitedlink/renderer/visitedlink_slave.h" | 73 #include "components/visitedlink/renderer/visitedlink_slave.h" |
72 #include "components/web_cache/renderer/web_cache_render_process_observer.h" | 74 #include "components/web_cache/renderer/web_cache_render_process_observer.h" |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 new prerender::PrerenderHelper(render_frame); | 553 new prerender::PrerenderHelper(render_frame); |
552 } | 554 } |
553 } | 555 } |
554 | 556 |
555 if (render_frame->GetRenderView()->GetMainRenderFrame() == render_frame) { | 557 if (render_frame->GetRenderView()->GetMainRenderFrame() == render_frame) { |
556 // Only attach NetErrorHelper to the main frame, since only the main frame | 558 // Only attach NetErrorHelper to the main frame, since only the main frame |
557 // should get error pages. | 559 // should get error pages. |
558 new NetErrorHelper(render_frame); | 560 new NetErrorHelper(render_frame); |
559 } | 561 } |
560 | 562 |
| 563 // Set up a mojo service to test if this page is a distiller page. |
| 564 new dom_distiller::DistillerJsRenderFrameObserver( |
| 565 render_frame, chrome::ISOLATED_WORLD_ID_CHROME_INTERNAL); |
| 566 |
561 PasswordAutofillAgent* password_autofill_agent = | 567 PasswordAutofillAgent* password_autofill_agent = |
562 new PasswordAutofillAgent(render_frame); | 568 new PasswordAutofillAgent(render_frame); |
563 PasswordGenerationAgent* password_generation_agent = | 569 PasswordGenerationAgent* password_generation_agent = |
564 new PasswordGenerationAgent(render_frame, password_autofill_agent); | 570 new PasswordGenerationAgent(render_frame, password_autofill_agent); |
565 new AutofillAgent(render_frame, password_autofill_agent, | 571 new AutofillAgent(render_frame, password_autofill_agent, |
566 password_generation_agent); | 572 password_generation_agent); |
567 } | 573 } |
568 | 574 |
569 void ChromeContentRendererClient::RenderViewCreated( | 575 void ChromeContentRendererClient::RenderViewCreated( |
570 content::RenderView* render_view) { | 576 content::RenderView* render_view) { |
(...skipping 1048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1619 WebString header_key(ASCIIToUTF16( | 1625 WebString header_key(ASCIIToUTF16( |
1620 data_reduction_proxy::chrome_proxy_header())); | 1626 data_reduction_proxy::chrome_proxy_header())); |
1621 if (!response.httpHeaderField(header_key).isNull() && | 1627 if (!response.httpHeaderField(header_key).isNull() && |
1622 response.httpHeaderField(header_key).utf8().find( | 1628 response.httpHeaderField(header_key).utf8().find( |
1623 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != | 1629 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != |
1624 std::string::npos) { | 1630 std::string::npos) { |
1625 (*properties)[data_reduction_proxy::chrome_proxy_header()] = | 1631 (*properties)[data_reduction_proxy::chrome_proxy_header()] = |
1626 data_reduction_proxy::chrome_proxy_lo_fi_directive(); | 1632 data_reduction_proxy::chrome_proxy_lo_fi_directive(); |
1627 } | 1633 } |
1628 } | 1634 } |
OLD | NEW |