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

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

Issue 2468423009: Remove plugins::MobileYouTubePlugin, deprecated by Flash embed override. (Closed)
Patch Set: Created 4 years, 1 month 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
« no previous file with comments | « no previous file | chrome/renderer/resources/plugins/mobile_youtube_plugin.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/dom_distiller_switches.h"
73 #include "components/dom_distiller/core/url_constants.h" 73 #include "components/dom_distiller/core/url_constants.h"
74 #include "components/error_page/common/localized_error.h" 74 #include "components/error_page/common/localized_error.h"
75 #include "components/network_hints/renderer/prescient_networking_dispatcher.h" 75 #include "components/network_hints/renderer/prescient_networking_dispatcher.h"
76 #include "components/password_manager/content/renderer/credential_manager_client .h" 76 #include "components/password_manager/content/renderer/credential_manager_client .h"
77 #include "components/pdf/renderer/pepper_pdf_host.h" 77 #include "components/pdf/renderer/pepper_pdf_host.h"
78 #include "components/plugins/renderer/mobile_youtube_plugin.h"
79 #include "components/signin/core/common/profile_management_switches.h" 78 #include "components/signin/core/common/profile_management_switches.h"
80 #include "components/startup_metric_utils/common/startup_metric.mojom.h" 79 #include "components/startup_metric_utils/common/startup_metric.mojom.h"
81 #include "components/subresource_filter/content/renderer/ruleset_dealer.h" 80 #include "components/subresource_filter/content/renderer/ruleset_dealer.h"
82 #include "components/subresource_filter/content/renderer/subresource_filter_agen t.h" 81 #include "components/subresource_filter/content/renderer/subresource_filter_agen t.h"
83 #include "components/version_info/version_info.h" 82 #include "components/version_info/version_info.h"
84 #include "components/visitedlink/renderer/visitedlink_slave.h" 83 #include "components/visitedlink/renderer/visitedlink_slave.h"
85 #include "components/web_cache/renderer/web_cache_impl.h" 84 #include "components/web_cache/renderer/web_cache_impl.h"
86 #include "content/public/common/content_constants.h" 85 #include "content/public/common/content_constants.h"
87 #include "content/public/common/content_switches.h" 86 #include "content/public/common/content_switches.h"
88 #include "content/public/common/url_constants.h" 87 #include "content/public/common/url_constants.h"
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 #include "extensions/common/extension_urls.h" 129 #include "extensions/common/extension_urls.h"
131 #include "extensions/common/switches.h" 130 #include "extensions/common/switches.h"
132 #include "extensions/renderer/dispatcher.h" 131 #include "extensions/renderer/dispatcher.h"
133 #include "extensions/renderer/renderer_extension_registry.h" 132 #include "extensions/renderer/renderer_extension_registry.h"
134 #endif 133 #endif
135 134
136 #if defined(ENABLE_PLUGINS) 135 #if defined(ENABLE_PLUGINS)
137 #include "chrome/common/plugin_utils.h" 136 #include "chrome/common/plugin_utils.h"
138 #include "chrome/renderer/plugins/chrome_plugin_placeholder.h" 137 #include "chrome/renderer/plugins/chrome_plugin_placeholder.h"
139 #include "chrome/renderer/plugins/power_saver_info.h" 138 #include "chrome/renderer/plugins/power_saver_info.h"
139 #else
140 #include "components/plugins/renderer/plugin_placeholder.h"
140 #endif 141 #endif
141 142
142 #if BUILDFLAG(ENABLE_PRINTING) 143 #if BUILDFLAG(ENABLE_PRINTING)
143 #include "chrome/common/chrome_content_client.h" 144 #include "chrome/common/chrome_content_client.h"
144 #include "chrome/renderer/printing/chrome_print_web_view_helper_delegate.h" 145 #include "chrome/renderer/printing/chrome_print_web_view_helper_delegate.h"
145 #include "components/printing/renderer/print_web_view_helper.h" 146 #include "components/printing/renderer/print_web_view_helper.h"
146 #include "printing/print_settings.h" 147 #include "printing/print_settings.h"
147 #endif 148 #endif
148 149
149 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) 150 #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 #endif 565 #endif
565 566
566 GURL url(params.url); 567 GURL url(params.url);
567 #if defined(ENABLE_PLUGINS) 568 #if defined(ENABLE_PLUGINS)
568 ChromeViewHostMsg_GetPluginInfo_Output output; 569 ChromeViewHostMsg_GetPluginInfo_Output output;
569 render_frame->Send(new ChromeViewHostMsg_GetPluginInfo( 570 render_frame->Send(new ChromeViewHostMsg_GetPluginInfo(
570 render_frame->GetRoutingID(), url, frame->top()->getSecurityOrigin(), 571 render_frame->GetRoutingID(), url, frame->top()->getSecurityOrigin(),
571 orig_mime_type, &output)); 572 orig_mime_type, &output));
572 *plugin = CreatePlugin(render_frame, frame, params, output); 573 *plugin = CreatePlugin(render_frame, frame, params, output);
573 #else // !defined(ENABLE_PLUGINS) 574 #else // !defined(ENABLE_PLUGINS)
574
575 #if defined(OS_ANDROID)
576 if (plugins::MobileYouTubePlugin::IsYouTubeURL(url, orig_mime_type)) {
577 base::StringPiece template_html(
578 ResourceBundle::GetSharedInstance().GetRawDataResource(
579 IDR_MOBILE_YOUTUBE_PLUGIN_HTML));
580 *plugin = (new plugins::MobileYouTubePlugin(render_frame, frame, params,
581 template_html))->plugin();
582 return true;
583 }
584 #endif // defined(OS_ANDROID)
585
586 PluginUMAReporter::GetInstance()->ReportPluginMissing(orig_mime_type, url); 575 PluginUMAReporter::GetInstance()->ReportPluginMissing(orig_mime_type, url);
587 *plugin = NonLoadablePluginPlaceholder::CreateNotSupportedPlugin( 576 *plugin = NonLoadablePluginPlaceholder::CreateNotSupportedPlugin(
588 render_frame, frame, params)->plugin(); 577 render_frame, frame, params)->plugin();
589 578
590 #endif // defined(ENABLE_PLUGINS) 579 #endif // defined(ENABLE_PLUGINS)
591 return true; 580 return true;
592 } 581 }
593 582
594 WebPlugin* ChromeContentRendererClient::CreatePluginReplacement( 583 WebPlugin* ChromeContentRendererClient::CreatePluginReplacement(
595 content::RenderFrame* render_frame, 584 content::RenderFrame* render_frame,
(...skipping 883 matching lines...) Expand 10 before | Expand all | Expand 10 after
1479 1468
1480 url::Replacements<char> r; 1469 url::Replacements<char> r;
1481 r.SetPath(path.c_str(), url::Component(0, path.length())); 1470 r.SetPath(path.c_str(), url::Component(0, path.length()));
1482 1471
1483 if (result == internal::NUM_PLUGIN_ERROR) 1472 if (result == internal::NUM_PLUGIN_ERROR)
1484 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; 1473 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS;
1485 1474
1486 RecordYouTubeRewriteUMA(result); 1475 RecordYouTubeRewriteUMA(result);
1487 return corrected_url.ReplaceComponents(r); 1476 return corrected_url.ReplaceComponents(r);
1488 } 1477 }
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/resources/plugins/mobile_youtube_plugin.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698