| 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 "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 #include "chrome/renderer/loadtimes_extension_bindings.h" | 42 #include "chrome/renderer/loadtimes_extension_bindings.h" |
| 43 #include "chrome/renderer/net/net_error_helper.h" | 43 #include "chrome/renderer/net/net_error_helper.h" |
| 44 #include "chrome/renderer/net/prescient_networking_dispatcher.h" | 44 #include "chrome/renderer/net/prescient_networking_dispatcher.h" |
| 45 #include "chrome/renderer/net/renderer_net_predictor.h" | 45 #include "chrome/renderer/net/renderer_net_predictor.h" |
| 46 #include "chrome/renderer/net_benchmarking_extension.h" | 46 #include "chrome/renderer/net_benchmarking_extension.h" |
| 47 #include "chrome/renderer/page_load_histograms.h" | 47 #include "chrome/renderer/page_load_histograms.h" |
| 48 #include "chrome/renderer/pepper/pepper_helper.h" | 48 #include "chrome/renderer/pepper/pepper_helper.h" |
| 49 #include "chrome/renderer/pepper/ppb_nacl_private_impl.h" | 49 #include "chrome/renderer/pepper/ppb_nacl_private_impl.h" |
| 50 #include "chrome/renderer/pepper/ppb_pdf_impl.h" | 50 #include "chrome/renderer/pepper/ppb_pdf_impl.h" |
| 51 #include "chrome/renderer/playback_extension.h" | 51 #include "chrome/renderer/playback_extension.h" |
| 52 #include "chrome/renderer/plugins/plugin_placeholder.h" | 52 #include "chrome/renderer/plugins/chrome_plugin_placeholder.h" |
| 53 #include "chrome/renderer/plugins/plugin_uma.h" | |
| 54 #include "chrome/renderer/prerender/prerender_dispatcher.h" | 53 #include "chrome/renderer/prerender/prerender_dispatcher.h" |
| 55 #include "chrome/renderer/prerender/prerender_helper.h" | 54 #include "chrome/renderer/prerender/prerender_helper.h" |
| 56 #include "chrome/renderer/prerender/prerender_media_load_deferrer.h" | 55 #include "chrome/renderer/prerender/prerender_media_load_deferrer.h" |
| 57 #include "chrome/renderer/prerender/prerenderer_client.h" | 56 #include "chrome/renderer/prerender/prerenderer_client.h" |
| 58 #include "chrome/renderer/printing/print_web_view_helper.h" | 57 #include "chrome/renderer/printing/print_web_view_helper.h" |
| 59 #include "chrome/renderer/safe_browsing/malware_dom_details.h" | 58 #include "chrome/renderer/safe_browsing/malware_dom_details.h" |
| 60 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" | 59 #include "chrome/renderer/safe_browsing/phishing_classifier_delegate.h" |
| 61 #include "chrome/renderer/searchbox/searchbox.h" | 60 #include "chrome/renderer/searchbox/searchbox.h" |
| 62 #include "chrome/renderer/searchbox/searchbox_extension.h" | 61 #include "chrome/renderer/searchbox/searchbox_extension.h" |
| 63 #include "chrome/renderer/tts_dispatcher.h" | 62 #include "chrome/renderer/tts_dispatcher.h" |
| 64 #include "chrome/renderer/validation_message_agent.h" | 63 #include "chrome/renderer/validation_message_agent.h" |
| 65 #include "components/autofill/content/renderer/autofill_agent.h" | 64 #include "components/autofill/content/renderer/autofill_agent.h" |
| 66 #include "components/autofill/content/renderer/password_autofill_agent.h" | 65 #include "components/autofill/content/renderer/password_autofill_agent.h" |
| 67 #include "components/autofill/content/renderer/password_generation_manager.h" | 66 #include "components/autofill/content/renderer/password_generation_manager.h" |
| 67 #include "components/plugins/renderer/mobile_youtube_plugin.h" |
| 68 #include "components/plugins/renderer/plugin_uma.h" |
| 68 #include "components/visitedlink/renderer/visitedlink_slave.h" | 69 #include "components/visitedlink/renderer/visitedlink_slave.h" |
| 69 #include "content/public/common/content_constants.h" | 70 #include "content/public/common/content_constants.h" |
| 70 #include "content/public/renderer/render_thread.h" | 71 #include "content/public/renderer/render_thread.h" |
| 71 #include "content/public/renderer/render_view.h" | 72 #include "content/public/renderer/render_view.h" |
| 72 #include "content/public/renderer/render_view_visitor.h" | 73 #include "content/public/renderer/render_view_visitor.h" |
| 73 #include "extensions/common/constants.h" | 74 #include "extensions/common/constants.h" |
| 74 #include "extensions/common/extension_urls.h" | 75 #include "extensions/common/extension_urls.h" |
| 75 #include "grit/generated_resources.h" | 76 #include "grit/generated_resources.h" |
| 76 #include "grit/locale_settings.h" | 77 #include "grit/locale_settings.h" |
| 77 #include "grit/renderer_resources.h" | 78 #include "grit/renderer_resources.h" |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 #else | 455 #else |
| 455 output.status.value = ChromeViewHostMsg_GetPluginInfo_Status::kNotFound; | 456 output.status.value = ChromeViewHostMsg_GetPluginInfo_Status::kNotFound; |
| 456 #endif | 457 #endif |
| 457 *plugin = CreatePlugin(render_view, frame, params, output); | 458 *plugin = CreatePlugin(render_view, frame, params, output); |
| 458 return true; | 459 return true; |
| 459 } | 460 } |
| 460 | 461 |
| 461 WebPlugin* ChromeContentRendererClient::CreatePluginReplacement( | 462 WebPlugin* ChromeContentRendererClient::CreatePluginReplacement( |
| 462 content::RenderView* render_view, | 463 content::RenderView* render_view, |
| 463 const base::FilePath& plugin_path) { | 464 const base::FilePath& plugin_path) { |
| 464 PluginPlaceholder* placeholder = | 465 ChromePluginPlaceholder* placeholder = |
| 465 PluginPlaceholder::CreateErrorPlugin(render_view, plugin_path); | 466 ChromePluginPlaceholder::CreateErrorPlugin(render_view, plugin_path); |
| 466 return placeholder->plugin(); | 467 return placeholder->plugin(); |
| 467 } | 468 } |
| 468 | 469 |
| 469 void ChromeContentRendererClient::DeferMediaLoad( | 470 void ChromeContentRendererClient::DeferMediaLoad( |
| 470 content::RenderView* render_view, | 471 content::RenderView* render_view, |
| 471 const base::Closure& closure) { | 472 const base::Closure& closure) { |
| 472 #if defined(OS_ANDROID) | 473 #if defined(OS_ANDROID) |
| 473 // Chromium for Android doesn't support prerender yet. | 474 // Chromium for Android doesn't support prerender yet. |
| 474 closure.Run(); | 475 closure.Run(); |
| 475 return; | 476 return; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 490 const WebPluginParams& original_params, | 491 const WebPluginParams& original_params, |
| 491 const ChromeViewHostMsg_GetPluginInfo_Output& output) { | 492 const ChromeViewHostMsg_GetPluginInfo_Output& output) { |
| 492 const ChromeViewHostMsg_GetPluginInfo_Status& status = output.status; | 493 const ChromeViewHostMsg_GetPluginInfo_Status& status = output.status; |
| 493 const WebPluginInfo& plugin = output.plugin; | 494 const WebPluginInfo& plugin = output.plugin; |
| 494 const std::string& actual_mime_type = output.actual_mime_type; | 495 const std::string& actual_mime_type = output.actual_mime_type; |
| 495 const string16& group_name = output.group_name; | 496 const string16& group_name = output.group_name; |
| 496 const std::string& identifier = output.group_identifier; | 497 const std::string& identifier = output.group_identifier; |
| 497 ChromeViewHostMsg_GetPluginInfo_Status::Value status_value = status.value; | 498 ChromeViewHostMsg_GetPluginInfo_Status::Value status_value = status.value; |
| 498 GURL url(original_params.url); | 499 GURL url(original_params.url); |
| 499 std::string orig_mime_type = original_params.mimeType.utf8(); | 500 std::string orig_mime_type = original_params.mimeType.utf8(); |
| 500 PluginPlaceholder* placeholder = NULL; | 501 ChromePluginPlaceholder* placeholder = NULL; |
| 501 | 502 |
| 502 // If the browser plugin is to be enabled, this should be handled by the | 503 // If the browser plugin is to be enabled, this should be handled by the |
| 503 // renderer, so the code won't reach here due to the early exit in | 504 // renderer, so the code won't reach here due to the early exit in |
| 504 // OverrideCreatePlugin. | 505 // OverrideCreatePlugin. |
| 505 if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kNotFound || | 506 if (status_value == ChromeViewHostMsg_GetPluginInfo_Status::kNotFound || |
| 506 orig_mime_type == content::kBrowserPluginMimeType) { | 507 orig_mime_type == content::kBrowserPluginMimeType) { |
| 507 #if defined(ENABLE_MOBILE_YOUTUBE_PLUGIN) | 508 #if defined(OS_ANDROID) |
| 508 if (PluginPlaceholder::IsYouTubeURL(url, orig_mime_type)) | 509 if (MobileYouTubePlugin::IsYouTubeURL(url, orig_mime_type)) { |
| 509 return PluginPlaceholder::CreateMobileYoutubePlugin(render_view, frame, | 510 base::StringPiece template_html( |
| 510 original_params)->plugin(); | 511 ResourceBundle::GetSharedInstance() |
| 512 .GetRawDataResource(IDR_MOBILE_YOUTUBE_PLUGIN_HTML)); |
| 513 return (new MobileYouTubePlugin( |
| 514 render_view, frame, original_params, template_html)) |
| 515 ->plugin(); |
| 516 } |
| 511 #endif | 517 #endif |
| 512 PluginUMAReporter::GetInstance()->ReportPluginMissing(orig_mime_type, url); | 518 PluginUMAReporter::GetInstance()->ReportPluginMissing(orig_mime_type, url); |
| 513 placeholder = PluginPlaceholder::CreateMissingPlugin( | 519 placeholder = ChromePluginPlaceholder::CreateMissingPlugin( |
| 514 render_view, frame, original_params); | 520 render_view, frame, original_params); |
| 515 } else { | 521 } else { |
| 516 // TODO(bauerb): This should be in content/. | 522 // TODO(bauerb): This should be in content/. |
| 517 WebPluginParams params(original_params); | 523 WebPluginParams params(original_params); |
| 518 for (size_t i = 0; i < plugin.mime_types.size(); ++i) { | 524 for (size_t i = 0; i < plugin.mime_types.size(); ++i) { |
| 519 if (plugin.mime_types[i].mime_type == actual_mime_type) { | 525 if (plugin.mime_types[i].mime_type == actual_mime_type) { |
| 520 AppendParams(plugin.mime_types[i].additional_param_names, | 526 AppendParams(plugin.mime_types[i].additional_param_names, |
| 521 plugin.mime_types[i].additional_param_values, | 527 plugin.mime_types[i].additional_param_values, |
| 522 ¶ms.attributeNames, | 528 ¶ms.attributeNames, |
| 523 ¶ms.attributeValues); | 529 ¶ms.attributeValues); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 case ChromeViewHostMsg_GetPluginInfo_Status::kAllowed: { | 581 case ChromeViewHostMsg_GetPluginInfo_Status::kAllowed: { |
| 576 const char* kPnaclMimeType = "application/x-pnacl"; | 582 const char* kPnaclMimeType = "application/x-pnacl"; |
| 577 if (actual_mime_type == kPnaclMimeType) { | 583 if (actual_mime_type == kPnaclMimeType) { |
| 578 if (CommandLine::ForCurrentProcess()->HasSwitch( | 584 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 579 switches::kDisablePnacl)) { | 585 switches::kDisablePnacl)) { |
| 580 frame->addMessageToConsole( | 586 frame->addMessageToConsole( |
| 581 WebConsoleMessage( | 587 WebConsoleMessage( |
| 582 WebConsoleMessage::LevelError, | 588 WebConsoleMessage::LevelError, |
| 583 "Portable Native Client must not be disabled in" | 589 "Portable Native Client must not be disabled in" |
| 584 " about:flags.")); | 590 " about:flags.")); |
| 585 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 591 placeholder = ChromePluginPlaceholder::CreateBlockedPlugin( |
| 586 render_view, frame, params, plugin, identifier, group_name, | 592 render_view, |
| 593 frame, |
| 594 params, |
| 595 plugin, |
| 596 identifier, |
| 597 group_name, |
| 587 IDR_BLOCKED_PLUGIN_HTML, | 598 IDR_BLOCKED_PLUGIN_HTML, |
| 588 #if defined(OS_CHROMEOS) | 599 #if defined(OS_CHROMEOS) |
| 589 l10n_util::GetStringUTF16(IDS_NACL_PLUGIN_BLOCKED)); | 600 l10n_util::GetStringUTF16(IDS_NACL_PLUGIN_BLOCKED)); |
| 590 #else | 601 #else |
| 591 l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); | 602 l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); |
| 592 #endif | 603 #endif |
| 593 break; | 604 break; |
| 594 } | 605 } |
| 595 } else { | 606 } else { |
| 596 const char* kNaClMimeType = "application/x-nacl"; | 607 const char* kNaClMimeType = "application/x-nacl"; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 627 app_url, | 638 app_url, |
| 628 is_nacl_unrestricted, | 639 is_nacl_unrestricted, |
| 629 extension, | 640 extension, |
| 630 ¶ms)) { | 641 ¶ms)) { |
| 631 frame->addMessageToConsole( | 642 frame->addMessageToConsole( |
| 632 WebConsoleMessage( | 643 WebConsoleMessage( |
| 633 WebConsoleMessage::LevelError, | 644 WebConsoleMessage::LevelError, |
| 634 "Only unpacked extensions and apps installed from the " | 645 "Only unpacked extensions and apps installed from the " |
| 635 "Chrome Web Store can load NaCl modules without enabling " | 646 "Chrome Web Store can load NaCl modules without enabling " |
| 636 "Native Client in about:flags.")); | 647 "Native Client in about:flags.")); |
| 637 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 648 placeholder = ChromePluginPlaceholder::CreateBlockedPlugin( |
| 638 render_view, frame, params, plugin, identifier, group_name, | 649 render_view, |
| 650 frame, |
| 651 params, |
| 652 plugin, |
| 653 identifier, |
| 654 group_name, |
| 639 IDR_BLOCKED_PLUGIN_HTML, | 655 IDR_BLOCKED_PLUGIN_HTML, |
| 640 #if defined(OS_CHROMEOS) | 656 #if defined(OS_CHROMEOS) |
| 641 l10n_util::GetStringUTF16(IDS_NACL_PLUGIN_BLOCKED)); | 657 l10n_util::GetStringUTF16(IDS_NACL_PLUGIN_BLOCKED)); |
| 642 #else | 658 #else |
| 643 l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); | 659 l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); |
| 644 #endif | 660 #endif |
| 645 break; | 661 break; |
| 646 } | 662 } |
| 647 } | 663 } |
| 648 } | 664 } |
| 649 | 665 |
| 650 // Delay loading plugins if prerendering. | 666 // Delay loading plugins if prerendering. |
| 651 // TODO(mmenke): In the case of prerendering, feed into | 667 // TODO(mmenke): In the case of prerendering, feed into |
| 652 // ChromeContentRendererClient::CreatePlugin instead, to | 668 // ChromeContentRendererClient::CreatePlugin instead, to |
| 653 // reduce the chance of future regressions. | 669 // reduce the chance of future regressions. |
| 654 if (prerender::PrerenderHelper::IsPrerendering(render_view)) { | 670 if (prerender::PrerenderHelper::IsPrerendering(render_view)) { |
| 655 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 671 placeholder = ChromePluginPlaceholder::CreateBlockedPlugin( |
| 656 render_view, frame, params, plugin, identifier, group_name, | 672 render_view, |
| 673 frame, |
| 674 params, |
| 675 plugin, |
| 676 identifier, |
| 677 group_name, |
| 657 IDR_CLICK_TO_PLAY_PLUGIN_HTML, | 678 IDR_CLICK_TO_PLAY_PLUGIN_HTML, |
| 658 l10n_util::GetStringFUTF16(IDS_PLUGIN_LOAD, group_name)); | 679 l10n_util::GetStringFUTF16(IDS_PLUGIN_LOAD, group_name)); |
| 659 placeholder->set_blocked_for_prerendering(true); | 680 placeholder->set_blocked_for_prerendering(true); |
| 660 placeholder->set_allow_loading(true); | 681 placeholder->set_allow_loading(true); |
| 661 break; | 682 break; |
| 662 } | 683 } |
| 663 | 684 |
| 664 return render_view->CreatePlugin(frame, plugin, params); | 685 return render_view->CreatePlugin(frame, plugin, params); |
| 665 } | 686 } |
| 666 case ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported: { | 687 case ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported: { |
| 667 RenderThread::Get()->RecordUserMetrics("Plugin_NPAPINotSupported"); | 688 RenderThread::Get()->RecordUserMetrics("Plugin_NPAPINotSupported"); |
| 668 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 689 placeholder = ChromePluginPlaceholder::CreateBlockedPlugin( |
| 669 render_view, frame, params, plugin, identifier, group_name, | 690 render_view, |
| 691 frame, |
| 692 params, |
| 693 plugin, |
| 694 identifier, |
| 695 group_name, |
| 670 IDR_BLOCKED_PLUGIN_HTML, | 696 IDR_BLOCKED_PLUGIN_HTML, |
| 671 l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_SUPPORTED_METRO)); | 697 l10n_util::GetStringUTF16(IDS_PLUGIN_NOT_SUPPORTED_METRO)); |
| 672 render_view->Send(new ChromeViewHostMsg_NPAPINotSupported( | 698 render_view->Send(new ChromeViewHostMsg_NPAPINotSupported( |
| 673 render_view->GetRoutingID(), identifier)); | 699 render_view->GetRoutingID(), identifier)); |
| 674 break; | 700 break; |
| 675 } | 701 } |
| 676 case ChromeViewHostMsg_GetPluginInfo_Status::kDisabled: { | 702 case ChromeViewHostMsg_GetPluginInfo_Status::kDisabled: { |
| 677 PluginUMAReporter::GetInstance()->ReportPluginDisabled(orig_mime_type, | 703 PluginUMAReporter::GetInstance()->ReportPluginDisabled(orig_mime_type, |
| 678 url); | 704 url); |
| 679 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 705 placeholder = ChromePluginPlaceholder::CreateBlockedPlugin( |
| 680 render_view, frame, params, plugin, identifier, group_name, | 706 render_view, |
| 707 frame, |
| 708 params, |
| 709 plugin, |
| 710 identifier, |
| 711 group_name, |
| 681 IDR_DISABLED_PLUGIN_HTML, | 712 IDR_DISABLED_PLUGIN_HTML, |
| 682 l10n_util::GetStringFUTF16(IDS_PLUGIN_DISABLED, group_name)); | 713 l10n_util::GetStringFUTF16(IDS_PLUGIN_DISABLED, group_name)); |
| 683 break; | 714 break; |
| 684 } | 715 } |
| 685 case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedBlocked: { | 716 case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedBlocked: { |
| 686 #if defined(ENABLE_PLUGIN_INSTALLATION) | 717 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 687 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 718 placeholder = ChromePluginPlaceholder::CreateBlockedPlugin( |
| 688 render_view, frame, params, plugin, identifier, group_name, | 719 render_view, |
| 720 frame, |
| 721 params, |
| 722 plugin, |
| 723 identifier, |
| 724 group_name, |
| 689 IDR_BLOCKED_PLUGIN_HTML, | 725 IDR_BLOCKED_PLUGIN_HTML, |
| 690 l10n_util::GetStringFUTF16(IDS_PLUGIN_OUTDATED, group_name)); | 726 l10n_util::GetStringFUTF16(IDS_PLUGIN_OUTDATED, group_name)); |
| 691 placeholder->set_allow_loading(true); | 727 placeholder->set_allow_loading(true); |
| 692 render_view->Send(new ChromeViewHostMsg_BlockedOutdatedPlugin( | 728 render_view->Send(new ChromeViewHostMsg_BlockedOutdatedPlugin( |
| 693 render_view->GetRoutingID(), placeholder->CreateRoutingId(), | 729 render_view->GetRoutingID(), placeholder->CreateRoutingId(), |
| 694 identifier)); | 730 identifier)); |
| 695 #else | 731 #else |
| 696 NOTREACHED(); | 732 NOTREACHED(); |
| 697 #endif | 733 #endif |
| 698 break; | 734 break; |
| 699 } | 735 } |
| 700 case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedDisallowed: { | 736 case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedDisallowed: { |
| 701 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 737 placeholder = ChromePluginPlaceholder::CreateBlockedPlugin( |
| 702 render_view, frame, params, plugin, identifier, group_name, | 738 render_view, |
| 739 frame, |
| 740 params, |
| 741 plugin, |
| 742 identifier, |
| 743 group_name, |
| 703 IDR_BLOCKED_PLUGIN_HTML, | 744 IDR_BLOCKED_PLUGIN_HTML, |
| 704 l10n_util::GetStringFUTF16(IDS_PLUGIN_OUTDATED, group_name)); | 745 l10n_util::GetStringFUTF16(IDS_PLUGIN_OUTDATED, group_name)); |
| 705 break; | 746 break; |
| 706 } | 747 } |
| 707 case ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized: { | 748 case ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized: { |
| 708 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 749 placeholder = ChromePluginPlaceholder::CreateBlockedPlugin( |
| 709 render_view, frame, params, plugin, identifier, group_name, | 750 render_view, |
| 751 frame, |
| 752 params, |
| 753 plugin, |
| 754 identifier, |
| 755 group_name, |
| 710 IDR_BLOCKED_PLUGIN_HTML, | 756 IDR_BLOCKED_PLUGIN_HTML, |
| 711 l10n_util::GetStringFUTF16(IDS_PLUGIN_NOT_AUTHORIZED, group_name)); | 757 l10n_util::GetStringFUTF16(IDS_PLUGIN_NOT_AUTHORIZED, group_name)); |
| 712 placeholder->set_allow_loading(true); | 758 placeholder->set_allow_loading(true); |
| 713 render_view->Send(new ChromeViewHostMsg_BlockedUnauthorizedPlugin( | 759 render_view->Send(new ChromeViewHostMsg_BlockedUnauthorizedPlugin( |
| 714 render_view->GetRoutingID(), | 760 render_view->GetRoutingID(), |
| 715 group_name, | 761 group_name, |
| 716 identifier)); | 762 identifier)); |
| 717 break; | 763 break; |
| 718 } | 764 } |
| 719 case ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay: { | 765 case ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay: { |
| 720 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 766 placeholder = ChromePluginPlaceholder::CreateBlockedPlugin( |
| 721 render_view, frame, params, plugin, identifier, group_name, | 767 render_view, |
| 768 frame, |
| 769 params, |
| 770 plugin, |
| 771 identifier, |
| 772 group_name, |
| 722 IDR_CLICK_TO_PLAY_PLUGIN_HTML, | 773 IDR_CLICK_TO_PLAY_PLUGIN_HTML, |
| 723 l10n_util::GetStringFUTF16(IDS_PLUGIN_LOAD, group_name)); | 774 l10n_util::GetStringFUTF16(IDS_PLUGIN_LOAD, group_name)); |
| 724 placeholder->set_allow_loading(true); | 775 placeholder->set_allow_loading(true); |
| 725 RenderThread::Get()->RecordUserMetrics("Plugin_ClickToPlay"); | 776 RenderThread::Get()->RecordUserMetrics("Plugin_ClickToPlay"); |
| 726 observer->DidBlockContentType(content_type, identifier); | 777 observer->DidBlockContentType(content_type, identifier); |
| 727 break; | 778 break; |
| 728 } | 779 } |
| 729 case ChromeViewHostMsg_GetPluginInfo_Status::kBlocked: { | 780 case ChromeViewHostMsg_GetPluginInfo_Status::kBlocked: { |
| 730 placeholder = PluginPlaceholder::CreateBlockedPlugin( | 781 placeholder = ChromePluginPlaceholder::CreateBlockedPlugin( |
| 731 render_view, frame, params, plugin, identifier, group_name, | 782 render_view, |
| 783 frame, |
| 784 params, |
| 785 plugin, |
| 786 identifier, |
| 787 group_name, |
| 732 IDR_BLOCKED_PLUGIN_HTML, | 788 IDR_BLOCKED_PLUGIN_HTML, |
| 733 l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); | 789 l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name)); |
| 734 placeholder->set_allow_loading(true); | 790 placeholder->set_allow_loading(true); |
| 735 RenderThread::Get()->RecordUserMetrics("Plugin_Blocked"); | 791 RenderThread::Get()->RecordUserMetrics("Plugin_Blocked"); |
| 736 observer->DidBlockContentType(content_type, identifier); | 792 observer->DidBlockContentType(content_type, identifier); |
| 737 break; | 793 break; |
| 738 } | 794 } |
| 739 } | 795 } |
| 740 } | 796 } |
| 741 placeholder->SetStatus(status); | 797 placeholder->SetStatus(status); |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1309 // SiteIsolationPolicy is off by default. We would like to activate cross-site | 1365 // SiteIsolationPolicy is off by default. We would like to activate cross-site |
| 1310 // document blocking (for UMA data collection) for normal renderer processes | 1366 // document blocking (for UMA data collection) for normal renderer processes |
| 1311 // running a normal web page from the Internet. We only turn on | 1367 // running a normal web page from the Internet. We only turn on |
| 1312 // SiteIsolationPolicy for a renderer process that does not have the extension | 1368 // SiteIsolationPolicy for a renderer process that does not have the extension |
| 1313 // flag on. | 1369 // flag on. |
| 1314 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 1370 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 1315 return !command_line->HasSwitch(switches::kExtensionProcess); | 1371 return !command_line->HasSwitch(switches::kExtensionProcess); |
| 1316 } | 1372 } |
| 1317 | 1373 |
| 1318 } // namespace chrome | 1374 } // namespace chrome |
| OLD | NEW |