| 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/field_trial.h" | 10 #include "base/metrics/field_trial.h" |
| (...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 777 status_value = | 777 status_value = |
| 778 ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported; | 778 ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported; |
| 779 } | 779 } |
| 780 #endif | 780 #endif |
| 781 | 781 |
| 782 auto create_blocked_plugin = | 782 auto create_blocked_plugin = |
| 783 [&render_frame, &frame, ¶ms, &info, &identifier, &group_name]( | 783 [&render_frame, &frame, ¶ms, &info, &identifier, &group_name]( |
| 784 int template_id, const base::string16& message) { | 784 int template_id, const base::string16& message) { |
| 785 return ChromePluginPlaceholder::CreateBlockedPlugin( | 785 return ChromePluginPlaceholder::CreateBlockedPlugin( |
| 786 render_frame, frame, params, info, identifier, group_name, | 786 render_frame, frame, params, info, identifier, group_name, |
| 787 template_id, message, std::string(), GURL()); | 787 template_id, message, std::string(), GURL(), gfx::Size()); |
| 788 }; | 788 }; |
| 789 switch (status_value) { | 789 switch (status_value) { |
| 790 case ChromeViewHostMsg_GetPluginInfo_Status::kNotFound: { | 790 case ChromeViewHostMsg_GetPluginInfo_Status::kNotFound: { |
| 791 NOTREACHED(); | 791 NOTREACHED(); |
| 792 break; | 792 break; |
| 793 } | 793 } |
| 794 case ChromeViewHostMsg_GetPluginInfo_Status::kAllowed: | 794 case ChromeViewHostMsg_GetPluginInfo_Status::kAllowed: |
| 795 case ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent: { | 795 case ChromeViewHostMsg_GetPluginInfo_Status::kPlayImportantContent: { |
| 796 #if !defined(DISABLE_NACL) && defined(ENABLE_EXTENSIONS) | 796 #if !defined(DISABLE_NACL) && defined(ENABLE_EXTENSIONS) |
| 797 const bool is_nacl_plugin = | 797 const bool is_nacl_plugin = |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 874 // reduce the chance of future regressions. | 874 // reduce the chance of future regressions. |
| 875 bool is_prerendering = | 875 bool is_prerendering = |
| 876 prerender::PrerenderHelper::IsPrerendering(render_frame); | 876 prerender::PrerenderHelper::IsPrerendering(render_frame); |
| 877 if (blocked_for_background_tab || is_prerendering || | 877 if (blocked_for_background_tab || is_prerendering || |
| 878 !poster_attribute.empty()) { | 878 !poster_attribute.empty()) { |
| 879 placeholder = ChromePluginPlaceholder::CreateBlockedPlugin( | 879 placeholder = ChromePluginPlaceholder::CreateBlockedPlugin( |
| 880 render_frame, frame, params, info, identifier, group_name, | 880 render_frame, frame, params, info, identifier, group_name, |
| 881 poster_attribute.empty() ? IDR_BLOCKED_PLUGIN_HTML | 881 poster_attribute.empty() ? IDR_BLOCKED_PLUGIN_HTML |
| 882 : IDR_PLUGIN_POSTER_HTML, | 882 : IDR_PLUGIN_POSTER_HTML, |
| 883 l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name), | 883 l10n_util::GetStringFUTF16(IDS_PLUGIN_BLOCKED, group_name), |
| 884 poster_attribute, frame->document().url()); | 884 poster_attribute, frame->document().url(), gfx::Size()); |
| 885 placeholder->set_blocked_for_background_tab( | 885 placeholder->set_blocked_for_background_tab( |
| 886 blocked_for_background_tab); | 886 blocked_for_background_tab); |
| 887 placeholder->set_blocked_for_prerendering(is_prerendering); | 887 placeholder->set_blocked_for_prerendering(is_prerendering); |
| 888 placeholder->set_power_saver_enabled(power_saver_enabled); | 888 placeholder->set_power_saver_enabled(power_saver_enabled); |
| 889 placeholder->set_allow_loading(true); | 889 placeholder->set_allow_loading(true); |
| 890 break; | 890 break; |
| 891 } | 891 } |
| 892 | 892 |
| 893 scoped_ptr<content::PluginInstanceThrottler> throttler; | 893 scoped_ptr<content::PluginInstanceThrottler> throttler; |
| 894 if (power_saver_enabled) { | 894 if (power_saver_enabled) { |
| (...skipping 746 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1641 if (mime_type == content::kBrowserPluginMimeType) { | 1641 if (mime_type == content::kBrowserPluginMimeType) { |
| 1642 return new extensions::ExtensionsGuestViewContainer(render_frame); | 1642 return new extensions::ExtensionsGuestViewContainer(render_frame); |
| 1643 } else { | 1643 } else { |
| 1644 return new extensions::MimeHandlerViewContainer( | 1644 return new extensions::MimeHandlerViewContainer( |
| 1645 render_frame, mime_type, original_url); | 1645 render_frame, mime_type, original_url); |
| 1646 } | 1646 } |
| 1647 #else | 1647 #else |
| 1648 return NULL; | 1648 return NULL; |
| 1649 #endif | 1649 #endif |
| 1650 } | 1650 } |
| OLD | NEW |