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" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 #include "chrome/renderer/worker_content_settings_client_proxy.h" | 55 #include "chrome/renderer/worker_content_settings_client_proxy.h" |
56 #include "components/autofill/content/renderer/autofill_agent.h" | 56 #include "components/autofill/content/renderer/autofill_agent.h" |
57 #include "components/autofill/content/renderer/password_autofill_agent.h" | 57 #include "components/autofill/content/renderer/password_autofill_agent.h" |
58 #include "components/autofill/content/renderer/password_generation_agent.h" | 58 #include "components/autofill/content/renderer/password_generation_agent.h" |
59 #include "components/content_settings/core/common/content_settings_pattern.h" | 59 #include "components/content_settings/core/common/content_settings_pattern.h" |
60 #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" |
61 #include "components/dom_distiller/core/url_constants.h" | 61 #include "components/dom_distiller/core/url_constants.h" |
62 #include "components/nacl/renderer/ppb_nacl_private.h" | 62 #include "components/nacl/renderer/ppb_nacl_private.h" |
63 #include "components/nacl/renderer/ppb_nacl_private_impl.h" | 63 #include "components/nacl/renderer/ppb_nacl_private_impl.h" |
64 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" | 64 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" |
| 65 #include "components/page_load_metrics/renderer/metrics_render_frame_observer.h" |
65 #include "components/password_manager/content/renderer/credential_manager_client
.h" | 66 #include "components/password_manager/content/renderer/credential_manager_client
.h" |
66 #include "components/pdf/renderer/pepper_pdf_host.h" | 67 #include "components/pdf/renderer/pepper_pdf_host.h" |
67 #include "components/plugins/renderer/mobile_youtube_plugin.h" | 68 #include "components/plugins/renderer/mobile_youtube_plugin.h" |
68 #include "components/signin/core/common/profile_management_switches.h" | 69 #include "components/signin/core/common/profile_management_switches.h" |
69 #include "components/version_info/version_info.h" | 70 #include "components/version_info/version_info.h" |
70 #include "components/visitedlink/renderer/visitedlink_slave.h" | 71 #include "components/visitedlink/renderer/visitedlink_slave.h" |
71 #include "components/web_cache/renderer/web_cache_render_process_observer.h" | 72 #include "components/web_cache/renderer/web_cache_render_process_observer.h" |
72 #include "content/public/common/content_constants.h" | 73 #include "content/public/common/content_constants.h" |
73 #include "content/public/renderer/plugin_instance_throttler.h" | 74 #include "content/public/renderer/plugin_instance_throttler.h" |
74 #include "content/public/renderer/render_frame.h" | 75 #include "content/public/renderer/render_frame.h" |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 new prerender::PrerenderHelper(render_frame); | 558 new prerender::PrerenderHelper(render_frame); |
558 } | 559 } |
559 } | 560 } |
560 | 561 |
561 if (render_frame->GetRenderView()->GetMainRenderFrame() == render_frame) { | 562 if (render_frame->GetRenderView()->GetMainRenderFrame() == render_frame) { |
562 // Only attach NetErrorHelper to the main frame, since only the main frame | 563 // Only attach NetErrorHelper to the main frame, since only the main frame |
563 // should get error pages. | 564 // should get error pages. |
564 new NetErrorHelper(render_frame); | 565 new NetErrorHelper(render_frame); |
565 } | 566 } |
566 | 567 |
| 568 if (render_frame->GetWebFrame()->parent() == nullptr) { |
| 569 // Only attach MainRenderFrameObserver to the main frame, since |
| 570 // we only want to log page load metrics for the main frame. |
| 571 new page_load_metrics::MetricsRenderFrameObserver(render_frame); |
| 572 } |
| 573 |
567 PasswordAutofillAgent* password_autofill_agent = | 574 PasswordAutofillAgent* password_autofill_agent = |
568 new PasswordAutofillAgent(render_frame); | 575 new PasswordAutofillAgent(render_frame); |
569 PasswordGenerationAgent* password_generation_agent = | 576 PasswordGenerationAgent* password_generation_agent = |
570 new PasswordGenerationAgent(render_frame, password_autofill_agent); | 577 new PasswordGenerationAgent(render_frame, password_autofill_agent); |
571 new AutofillAgent(render_frame, password_autofill_agent, | 578 new AutofillAgent(render_frame, password_autofill_agent, |
572 password_generation_agent); | 579 password_generation_agent); |
573 } | 580 } |
574 | 581 |
575 void ChromeContentRendererClient::RenderViewCreated( | 582 void ChromeContentRendererClient::RenderViewCreated( |
576 content::RenderView* render_view) { | 583 content::RenderView* render_view) { |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1654 } | 1661 } |
1655 | 1662 |
1656 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( | 1663 void ChromeContentRendererClient::WillDestroyServiceWorkerContextOnWorkerThread( |
1657 v8::Local<v8::Context> context, | 1664 v8::Local<v8::Context> context, |
1658 const GURL& url) { | 1665 const GURL& url) { |
1659 #if defined(ENABLE_EXTENSIONS) | 1666 #if defined(ENABLE_EXTENSIONS) |
1660 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread(context, | 1667 extensions::Dispatcher::WillDestroyServiceWorkerContextOnWorkerThread(context, |
1661 url); | 1668 url); |
1662 #endif | 1669 #endif |
1663 } | 1670 } |
OLD | NEW |