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

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

Issue 777103002: Add the names of plugins to the blocked plugin bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: make mergeable by reusing an existing string with existing translation Created 6 years 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
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 "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/debug/crash_logging.h" 8 #include "base/debug/crash_logging.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 859 matching lines...) Expand 10 before | Expand all | Expand 10 after
870 std::string trial_group = 870 std::string trial_group =
871 base::FieldTrialList::FindFullName("UnauthorizedPluginInfoBar"); 871 base::FieldTrialList::FindFullName("UnauthorizedPluginInfoBar");
872 if (plugin.type != content::WebPluginInfo::PLUGIN_TYPE_NPAPI || 872 if (plugin.type != content::WebPluginInfo::PLUGIN_TYPE_NPAPI ||
873 trial_group == "Enabled") { 873 trial_group == "Enabled") {
874 render_frame->Send(new ChromeViewHostMsg_BlockedUnauthorizedPlugin( 874 render_frame->Send(new ChromeViewHostMsg_BlockedUnauthorizedPlugin(
875 render_frame->GetRoutingID(), 875 render_frame->GetRoutingID(),
876 group_name, 876 group_name,
877 identifier)); 877 identifier));
878 } else { 878 } else {
879 // Send IPC for showing blocked plugins page action. 879 // Send IPC for showing blocked plugins page action.
880 observer->DidBlockContentType(content_type); 880 observer->DidBlockContentType(content_type, plugin.name);
881 } 881 }
882 break; 882 break;
883 } 883 }
884 case ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay: { 884 case ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay: {
885 placeholder = create_blocked_plugin( 885 placeholder = create_blocked_plugin(
886 IDR_CLICK_TO_PLAY_PLUGIN_HTML, 886 IDR_CLICK_TO_PLAY_PLUGIN_HTML,
887 l10n_util::GetStringFUTF16(IDS_PLUGIN_LOAD, group_name), GURL()); 887 l10n_util::GetStringFUTF16(IDS_PLUGIN_LOAD, group_name), GURL());
888 placeholder->set_allow_loading(true); 888 placeholder->set_allow_loading(true);
889 RenderThread::Get()->RecordAction( 889 RenderThread::Get()->RecordAction(
890 UserMetricsAction("Plugin_ClickToPlay")); 890 UserMetricsAction("Plugin_ClickToPlay"));
891 observer->DidBlockContentType(content_type); 891 observer->DidBlockContentType(content_type, plugin.name);
892 break; 892 break;
893 } 893 }
894 case ChromeViewHostMsg_GetPluginInfo_Status::kBlocked: { 894 case ChromeViewHostMsg_GetPluginInfo_Status::kBlocked: {
895 placeholder = create_blocked_plugin( 895 placeholder = create_blocked_plugin(
896 IDR_BLOCKED_PLUGIN_HTML, 896 IDR_BLOCKED_PLUGIN_HTML,
897 l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name), GURL()); 897 l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name), GURL());
898 placeholder->set_allow_loading(true); 898 placeholder->set_allow_loading(true);
899 RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked")); 899 RenderThread::Get()->RecordAction(UserMetricsAction("Plugin_Blocked"));
900 observer->DidBlockContentType(content_type); 900 observer->DidBlockContentType(content_type, plugin.name);
901 break; 901 break;
902 } 902 }
903 case ChromeViewHostMsg_GetPluginInfo_Status::kBlockedByPolicy: { 903 case ChromeViewHostMsg_GetPluginInfo_Status::kBlockedByPolicy: {
904 placeholder = create_blocked_plugin( 904 placeholder = create_blocked_plugin(
905 IDR_BLOCKED_PLUGIN_HTML, 905 IDR_BLOCKED_PLUGIN_HTML,
906 l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name), GURL()); 906 l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name), GURL());
907 placeholder->set_allow_loading(false); 907 placeholder->set_allow_loading(false);
908 RenderThread::Get()->RecordAction( 908 RenderThread::Get()->RecordAction(
909 UserMetricsAction("Plugin_BlockedByPolicy")); 909 UserMetricsAction("Plugin_BlockedByPolicy"));
910 observer->DidBlockContentType(content_type); 910 observer->DidBlockContentType(content_type, plugin.name);
911 break; 911 break;
912 } 912 }
913 } 913 }
914 } 914 }
915 placeholder->SetStatus(status); 915 placeholder->SetStatus(status);
916 return placeholder->plugin(); 916 return placeholder->plugin();
917 } 917 }
918 918
919 // For NaCl content handling plugins, the NaCl manifest is stored in an 919 // For NaCl content handling plugins, the NaCl manifest is stored in an
920 // additonal 'nacl' param associated with the MIME type. 920 // additonal 'nacl' param associated with the MIME type.
(...skipping 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
1570 if (mime_type == content::kBrowserPluginMimeType) { 1570 if (mime_type == content::kBrowserPluginMimeType) {
1571 return new extensions::ExtensionsGuestViewContainer(render_frame); 1571 return new extensions::ExtensionsGuestViewContainer(render_frame);
1572 } else { 1572 } else {
1573 return new extensions::MimeHandlerViewContainer( 1573 return new extensions::MimeHandlerViewContainer(
1574 render_frame, mime_type, original_url); 1574 render_frame, mime_type, original_url);
1575 } 1575 }
1576 #else 1576 #else
1577 return NULL; 1577 return NULL;
1578 #endif 1578 #endif
1579 } 1579 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698