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

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

Issue 13414007: Report disabled plugin in CreatePlugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 months 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 | Annotate | Revision Log
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 <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 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 // If the browser plugin is to be enabled, this should be handled by the 513 // If the browser plugin is to be enabled, this should be handled by the
514 // renderer, so the code won't reach here due to the early exit in 514 // renderer, so the code won't reach here due to the early exit in
515 // OverrideCreatePlugin. 515 // OverrideCreatePlugin.
516 if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kNotFound || 516 if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kNotFound ||
517 orig_mime_type == content::kBrowserPluginMimeType) { 517 orig_mime_type == content::kBrowserPluginMimeType) {
518 #if defined(ENABLE_MOBILE_YOUTUBE_PLUGIN) 518 #if defined(ENABLE_MOBILE_YOUTUBE_PLUGIN)
519 if (PluginPlaceholder::IsYouTubeURL(url, orig_mime_type)) 519 if (PluginPlaceholder::IsYouTubeURL(url, orig_mime_type))
520 return PluginPlaceholder::CreateMobileYoutubePlugin(render_view, frame, 520 return PluginPlaceholder::CreateMobileYoutubePlugin(render_view, frame,
521 original_params)->plugin(); 521 original_params)->plugin();
522 #endif 522 #endif
523 MissingPluginReporter::GetInstance()->ReportPluginMissing( 523 PluginUMAReporter::GetInstance()->ReportPluginMissing(orig_mime_type, url);
524 orig_mime_type, url);
525 placeholder = PluginPlaceholder::CreateMissingPlugin( 524 placeholder = PluginPlaceholder::CreateMissingPlugin(
526 render_view, frame, original_params); 525 render_view, frame, original_params);
527 } else { 526 } else {
528 // TODO(bauerb): This should be in content/. 527 // TODO(bauerb): This should be in content/.
529 WebPluginParams params(original_params); 528 WebPluginParams params(original_params);
530 for (size_t i = 0; i < plugin.mime_types.size(); ++i) { 529 for (size_t i = 0; i < plugin.mime_types.size(); ++i) {
531 if (plugin.mime_types[i].mime_type == actual_mime_type) { 530 if (plugin.mime_types[i].mime_type == actual_mime_type) {
532 AppendParams(plugin.mime_types[i].additional_param_names, 531 AppendParams(plugin.mime_types[i].additional_param_names,
533 plugin.mime_types[i].additional_param_values, 532 plugin.mime_types[i].additional_param_values,
534 &params.attributeNames, 533 &params.attributeNames,
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 RenderThread::Get()->RecordUserMetrics("Plugin_NPAPINotSupported"); 637 RenderThread::Get()->RecordUserMetrics("Plugin_NPAPINotSupported");
639 placeholder = PluginPlaceholder::CreateBlockedPlugin( 638 placeholder = PluginPlaceholder::CreateBlockedPlugin(
640 render_view, frame, params, plugin, identifier, group_name, 639 render_view, frame, params, plugin, identifier, group_name,
641 IDR_BLOCKED_PLUGIN_HTML, 640 IDR_BLOCKED_PLUGIN_HTML,
642 l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_SUPPORTED_METRO)); 641 l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_SUPPORTED_METRO));
643 render_view->Send(new ChromeViewHostMsg_NPAPINotSupported( 642 render_view->Send(new ChromeViewHostMsg_NPAPINotSupported(
644 render_view->GetRoutingID(), identifier)); 643 render_view->GetRoutingID(), identifier));
645 break; 644 break;
646 } 645 }
647 case ChromeViewHostMsg_GetPluginInfo_Status::kDisabled: { 646 case ChromeViewHostMsg_GetPluginInfo_Status::kDisabled: {
647 PluginUMAReporter::GetInstance()->ReportPluginDisabled(orig_mime_type,
648 url);
648 placeholder = PluginPlaceholder::CreateBlockedPlugin( 649 placeholder = PluginPlaceholder::CreateBlockedPlugin(
649 render_view, frame, params, plugin, identifier, group_name, 650 render_view, frame, params, plugin, identifier, group_name,
650 IDR_DISABLED_PLUGIN_HTML, 651 IDR_DISABLED_PLUGIN_HTML,
651 l10n_util::GetStringFUTF16(IDS_PLUGIN_DISABLED, group_name)); 652 l10n_util::GetStringFUTF16(IDS_PLUGIN_DISABLED, group_name));
652 break; 653 break;
653 } 654 }
654 case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedBlocked: { 655 case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedBlocked: {
655 #if defined(ENABLE_PLUGIN_INSTALLATION) 656 #if defined(ENABLE_PLUGIN_INSTALLATION)
656 placeholder = PluginPlaceholder::CreateBlockedPlugin( 657 placeholder = PluginPlaceholder::CreateBlockedPlugin(
657 render_view, frame, params, plugin, identifier, group_name, 658 render_view, frame, params, plugin, identifier, group_name,
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 return true; 1226 return true;
1226 } 1227 }
1227 1228
1228 if (request_os_file_handle_allowed_hosts_.count(inner.host())) 1229 if (request_os_file_handle_allowed_hosts_.count(inner.host()))
1229 return true; 1230 return true;
1230 1231
1231 return false; 1232 return false;
1232 } 1233 }
1233 1234
1234 } // namespace chrome 1235 } // namespace chrome
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/plugins/plugin_placeholder.cc » ('j') | chrome/renderer/plugins/plugin_uma_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698