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 <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
504 const ChromeViewHostMsg_GetPluginInfo_Output& output) { | 504 const ChromeViewHostMsg_GetPluginInfo_Output& output) { |
505 const ChromeViewHostMsg_GetPluginInfo_Status& status = output.status; | 505 const ChromeViewHostMsg_GetPluginInfo_Status& status = output.status; |
506 const WebPluginInfo& plugin = output.plugin; | 506 const WebPluginInfo& plugin = output.plugin; |
507 const std::string& actual_mime_type = output.actual_mime_type; | 507 const std::string& actual_mime_type = output.actual_mime_type; |
508 const string16& group_name = output.group_name; | 508 const string16& group_name = output.group_name; |
509 const std::string& identifier = output.group_identifier; | 509 const std::string& identifier = output.group_identifier; |
510 ChromeViewHostMsg_GetPluginInfo_Status::Value status_value = status.value; | 510 ChromeViewHostMsg_GetPluginInfo_Status::Value status_value = status.value; |
511 GURL url(original_params.url); | 511 GURL url(original_params.url); |
512 std::string orig_mime_type = original_params.mimeType.utf8(); | 512 std::string orig_mime_type = original_params.mimeType.utf8(); |
513 PluginPlaceholder* placeholder = NULL; | 513 PluginPlaceholder* placeholder = NULL; |
514 | 514 |
ddorwin
2013/04/04 19:09:50
We could do a histogram of values based on this |s
Bernhard Bauer
2013/04/04 21:14:31
The other place should be fine. What happens is th
xhwang
2013/04/04 23:10:33
That's a good suggestion. But probably belongs to
| |
515 // If the browser plugin is to be enabled, this should be handled by the | 515 // If the browser plugin is to be enabled, this should be handled by the |
516 // renderer, so the code won't reach here due to the early exit in | 516 // renderer, so the code won't reach here due to the early exit in |
517 // OverrideCreatePlugin. | 517 // OverrideCreatePlugin. |
518 if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kNotFound || | 518 if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kNotFound || |
519 orig_mime_type == content::kBrowserPluginMimeType) { | 519 orig_mime_type == content::kBrowserPluginMimeType) { |
ddorwin
2013/04/04 19:09:50
I wonder if kBrowserPluginMimeType is polluting st
xhwang
2013/04/04 23:10:33
sg, but that'll belong to another CL.
| |
520 #if defined(ENABLE_MOBILE_YOUTUBE_PLUGIN) | 520 #if defined(ENABLE_MOBILE_YOUTUBE_PLUGIN) |
521 if (PluginPlaceholder::IsYouTubeURL(url, orig_mime_type)) | 521 if (PluginPlaceholder::IsYouTubeURL(url, orig_mime_type)) |
522 return PluginPlaceholder::CreateMobileYoutubePlugin(render_view, frame, | 522 return PluginPlaceholder::CreateMobileYoutubePlugin(render_view, frame, |
523 original_params)->plugin(); | 523 original_params)->plugin(); |
524 #endif | 524 #endif |
525 MissingPluginReporter::GetInstance()->ReportPluginMissing( | 525 PluginUMAReporter::GetInstance()->ReportPluginMissing(orig_mime_type, url); |
526 orig_mime_type, url); | |
527 placeholder = PluginPlaceholder::CreateMissingPlugin( | 526 placeholder = PluginPlaceholder::CreateMissingPlugin( |
528 render_view, frame, original_params); | 527 render_view, frame, original_params); |
529 } else { | 528 } else { |
530 // TODO(bauerb): This should be in content/. | 529 // TODO(bauerb): This should be in content/. |
531 WebPluginParams params(original_params); | 530 WebPluginParams params(original_params); |
532 for (size_t i = 0; i < plugin.mime_types.size(); ++i) { | 531 for (size_t i = 0; i < plugin.mime_types.size(); ++i) { |
533 if (plugin.mime_types[i].mime_type == actual_mime_type) { | 532 if (plugin.mime_types[i].mime_type == actual_mime_type) { |
534 AppendParams(plugin.mime_types[i].additional_param_names, | 533 AppendParams(plugin.mime_types[i].additional_param_names, |
535 plugin.mime_types[i].additional_param_values, | 534 plugin.mime_types[i].additional_param_values, |
536 ¶ms.attributeNames, | 535 ¶ms.attributeNames, |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
640 RenderThread::Get()->RecordUserMetrics("Plugin_NPAPINotSupported"); | 639 RenderThread::Get()->RecordUserMetrics("Plugin_NPAPINotSupported"); |
641 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 640 placeholder = PluginPlaceholder::CreateBlockedPlugin( |
642 render_view, frame, params, plugin, identifier, group_name, | 641 render_view, frame, params, plugin, identifier, group_name, |
643 IDR_BLOCKED_PLUGIN_HTML, | 642 IDR_BLOCKED_PLUGIN_HTML, |
644 l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_SUPPORTED_METRO)); | 643 l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_SUPPORTED_METRO)); |
645 render_view->Send(new ChromeViewHostMsg_NPAPINotSupported( | 644 render_view->Send(new ChromeViewHostMsg_NPAPINotSupported( |
646 render_view->GetRoutingID(), identifier)); | 645 render_view->GetRoutingID(), identifier)); |
647 break; | 646 break; |
648 } | 647 } |
649 case ChromeViewHostMsg_GetPluginInfo_Status::kDisabled: { | 648 case ChromeViewHostMsg_GetPluginInfo_Status::kDisabled: { |
649 PluginUMAReporter::GetInstance()->ReportPluginDisabled(orig_mime_type, | |
650 url); | |
650 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 651 placeholder = PluginPlaceholder::CreateBlockedPlugin( |
651 render_view, frame, params, plugin, identifier, group_name, | 652 render_view, frame, params, plugin, identifier, group_name, |
652 IDR_DISABLED_PLUGIN_HTML, | 653 IDR_DISABLED_PLUGIN_HTML, |
653 l10n_util::GetStringFUTF16(IDS_PLUGIN_DISABLED, group_name)); | 654 l10n_util::GetStringFUTF16(IDS_PLUGIN_DISABLED, group_name)); |
654 break; | 655 break; |
655 } | 656 } |
656 case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedBlocked: { | 657 case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedBlocked: { |
657 #if defined(ENABLE_PLUGIN_INSTALLATION) | 658 #if defined(ENABLE_PLUGIN_INSTALLATION) |
658 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 659 placeholder = PluginPlaceholder::CreateBlockedPlugin( |
659 render_view, frame, params, plugin, identifier, group_name, | 660 render_view, frame, params, plugin, identifier, group_name, |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1227 return true; | 1228 return true; |
1228 } | 1229 } |
1229 | 1230 |
1230 if (request_os_file_handle_allowed_hosts_.count(inner.host())) | 1231 if (request_os_file_handle_allowed_hosts_.count(inner.host())) |
1231 return true; | 1232 return true; |
1232 | 1233 |
1233 return false; | 1234 return false; |
1234 } | 1235 } |
1235 | 1236 |
1236 } // namespace chrome | 1237 } // namespace chrome |
OLD | NEW |