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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) { |
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 |