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