Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 1231083007: Expose distiller functions to JavaScript (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@refactor-content
Patch Set: Address comments Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
18 #include "chrome/common/chrome_paths.h" 19 #include "chrome/common/chrome_paths.h"
19 #include "chrome/common/chrome_switches.h" 20 #include "chrome/common/chrome_switches.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"
27 #include "chrome/grit/generated_resources.h" 28 #include "chrome/grit/generated_resources.h"
(...skipping 25 matching lines...) Expand all
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/version_info/version_info.h" 73 #include "components/version_info/version_info.h"
72 #include "components/visitedlink/renderer/visitedlink_slave.h" 74 #include "components/visitedlink/renderer/visitedlink_slave.h"
(...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 new prerender::PrerenderHelper(render_frame); 554 new prerender::PrerenderHelper(render_frame);
553 } 555 }
554 } 556 }
555 557
556 if (render_frame->GetRenderView()->GetMainRenderFrame() == render_frame) { 558 if (render_frame->GetRenderView()->GetMainRenderFrame() == render_frame) {
557 // Only attach NetErrorHelper to the main frame, since only the main frame 559 // Only attach NetErrorHelper to the main frame, since only the main frame
558 // should get error pages. 560 // should get error pages.
559 new NetErrorHelper(render_frame); 561 new NetErrorHelper(render_frame);
560 } 562 }
561 563
564 // Set up a mojo service to test if this page is a distiller page.
565 new dom_distiller::DistillerJsRenderFrameObserver(
566 render_frame, chrome::ISOLATED_WORLD_ID_CHROME_INTERNAL);
567
562 PasswordAutofillAgent* password_autofill_agent = 568 PasswordAutofillAgent* password_autofill_agent =
563 new PasswordAutofillAgent(render_frame); 569 new PasswordAutofillAgent(render_frame);
564 PasswordGenerationAgent* password_generation_agent = 570 PasswordGenerationAgent* password_generation_agent =
565 new PasswordGenerationAgent(render_frame, password_autofill_agent); 571 new PasswordGenerationAgent(render_frame, password_autofill_agent);
566 new AutofillAgent(render_frame, password_autofill_agent, 572 new AutofillAgent(render_frame, password_autofill_agent,
567 password_generation_agent); 573 password_generation_agent);
568 } 574 }
569 575
570 void ChromeContentRendererClient::RenderViewCreated( 576 void ChromeContentRendererClient::RenderViewCreated(
571 content::RenderView* render_view) { 577 content::RenderView* render_view) {
(...skipping 1050 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 WebString header_key(ASCIIToUTF16( 1628 WebString header_key(ASCIIToUTF16(
1623 data_reduction_proxy::chrome_proxy_header())); 1629 data_reduction_proxy::chrome_proxy_header()));
1624 if (!response.httpHeaderField(header_key).isNull() && 1630 if (!response.httpHeaderField(header_key).isNull() &&
1625 response.httpHeaderField(header_key).utf8().find( 1631 response.httpHeaderField(header_key).utf8().find(
1626 data_reduction_proxy::chrome_proxy_lo_fi_directive()) != 1632 data_reduction_proxy::chrome_proxy_lo_fi_directive()) !=
1627 std::string::npos) { 1633 std::string::npos) {
1628 (*properties)[data_reduction_proxy::chrome_proxy_header()] = 1634 (*properties)[data_reduction_proxy::chrome_proxy_header()] =
1629 data_reduction_proxy::chrome_proxy_lo_fi_directive(); 1635 data_reduction_proxy::chrome_proxy_lo_fi_directive();
1630 } 1636 }
1631 } 1637 }
OLDNEW
« no previous file with comments | « chrome/renderer/DEPS ('k') | chrome/test/BUILD.gn » ('j') | components/dom_distiller.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698