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 // TODO(xhwang): Distinguish between kNotFound and kBrowserPluginMimeType. |
ddorwin
2013/04/04 23:56:47
I don't think that's quite right. Either way, if y
xhwang
2013/04/05 01:00:24
Done.
| |
526 orig_mime_type, url); | 526 PluginUMAReporter::GetInstance()->ReportPluginMissing(orig_mime_type, url); |
527 placeholder = PluginPlaceholder::CreateMissingPlugin( | 527 placeholder = PluginPlaceholder::CreateMissingPlugin( |
528 render_view, frame, original_params); | 528 render_view, frame, original_params); |
529 } else { | 529 } else { |
530 // TODO(bauerb): This should be in content/. | 530 // TODO(bauerb): This should be in content/. |
531 WebPluginParams params(original_params); | 531 WebPluginParams params(original_params); |
532 for (size_t i = 0; i < plugin.mime_types.size(); ++i) { | 532 for (size_t i = 0; i < plugin.mime_types.size(); ++i) { |
533 if (plugin.mime_types[i].mime_type == actual_mime_type) { | 533 if (plugin.mime_types[i].mime_type == actual_mime_type) { |
534 AppendParams(plugin.mime_types[i].additional_param_names, | 534 AppendParams(plugin.mime_types[i].additional_param_names, |
535 plugin.mime_types[i].additional_param_values, | 535 plugin.mime_types[i].additional_param_values, |
536 ¶ms.attributeNames, | 536 ¶ms.attributeNames, |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
640 RenderThread::Get()->RecordUserMetrics("Plugin_NPAPINotSupported"); | 640 RenderThread::Get()->RecordUserMetrics("Plugin_NPAPINotSupported"); |
641 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 641 placeholder = PluginPlaceholder::CreateBlockedPlugin( |
642 render_view, frame, params, plugin, identifier, group_name, | 642 render_view, frame, params, plugin, identifier, group_name, |
643 IDR_BLOCKED_PLUGIN_HTML, | 643 IDR_BLOCKED_PLUGIN_HTML, |
644 l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_SUPPORTED_METRO)); | 644 l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_SUPPORTED_METRO)); |
645 render_view->Send(new ChromeViewHostMsg_NPAPINotSupported( | 645 render_view->Send(new ChromeViewHostMsg_NPAPINotSupported( |
646 render_view->GetRoutingID(), identifier)); | 646 render_view->GetRoutingID(), identifier)); |
647 break; | 647 break; |
648 } | 648 } |
649 case ChromeViewHostMsg_GetPluginInfo_Status::kDisabled: { | 649 case ChromeViewHostMsg_GetPluginInfo_Status::kDisabled: { |
650 PluginUMAReporter::GetInstance()->ReportPluginDisabled(orig_mime_type, | |
651 url); | |
650 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 652 placeholder = PluginPlaceholder::CreateBlockedPlugin( |
651 render_view, frame, params, plugin, identifier, group_name, | 653 render_view, frame, params, plugin, identifier, group_name, |
652 IDR_DISABLED_PLUGIN_HTML, | 654 IDR_DISABLED_PLUGIN_HTML, |
653 l10n_util::GetStringFUTF16(IDS_PLUGIN_DISABLED, group_name)); | 655 l10n_util::GetStringFUTF16(IDS_PLUGIN_DISABLED, group_name)); |
654 break; | 656 break; |
655 } | 657 } |
656 case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedBlocked: { | 658 case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedBlocked: { |
657 #if defined(ENABLE_PLUGIN_INSTALLATION) | 659 #if defined(ENABLE_PLUGIN_INSTALLATION) |
658 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 660 placeholder = PluginPlaceholder::CreateBlockedPlugin( |
659 render_view, frame, params, plugin, identifier, group_name, | 661 render_view, frame, params, plugin, identifier, group_name, |
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1227 return true; | 1229 return true; |
1228 } | 1230 } |
1229 | 1231 |
1230 if (request_os_file_handle_allowed_hosts_.count(inner.host())) | 1232 if (request_os_file_handle_allowed_hosts_.count(inner.host())) |
1231 return true; | 1233 return true; |
1232 | 1234 |
1233 return false; | 1235 return false; |
1234 } | 1236 } |
1235 | 1237 |
1236 } // namespace chrome | 1238 } // namespace chrome |
OLD | NEW |