| 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 <memory> | 7 #include <memory> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/debug/crash_logging.h" | 11 #include "base/debug/crash_logging.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/metrics/field_trial.h" | 14 #include "base/metrics/field_trial.h" |
| 15 #include "base/metrics/histogram.h" | 15 #include "base/metrics/histogram.h" |
| 16 #include "base/metrics/user_metrics_action.h" | 16 #include "base/metrics/user_metrics_action.h" |
| 17 #include "base/strings/string_number_conversions.h" | 17 #include "base/strings/string_number_conversions.h" |
| 18 #include "base/strings/string_util.h" | 18 #include "base/strings/string_util.h" |
| 19 #include "base/strings/utf_string_conversions.h" | 19 #include "base/strings/utf_string_conversions.h" |
| 20 #include "base/time/time.h" | 20 #include "base/time/time.h" |
| 21 #include "base/values.h" | 21 #include "base/values.h" |
| 22 #include "build/build_config.h" | 22 #include "build/build_config.h" |
| 23 #include "chrome/common/channel_info.h" | 23 #include "chrome/common/channel_info.h" |
| 24 #include "chrome/common/chrome_features.h" | 24 #include "chrome/common/chrome_features.h" |
| 25 #include "chrome/common/chrome_isolated_world_ids.h" | 25 #include "chrome/common/chrome_isolated_world_ids.h" |
| 26 #include "chrome/common/chrome_paths.h" | 26 #include "chrome/common/chrome_paths.h" |
| 27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
| 28 #include "chrome/common/crash_keys.h" | 28 #include "chrome/common/crash_keys.h" |
| 29 #include "chrome/common/features.h" |
| 29 #include "chrome/common/pepper_permission_util.h" | 30 #include "chrome/common/pepper_permission_util.h" |
| 30 #include "chrome/common/prerender_types.h" | 31 #include "chrome/common/prerender_types.h" |
| 31 #include "chrome/common/render_messages.h" | 32 #include "chrome/common/render_messages.h" |
| 32 #include "chrome/common/secure_origin_whitelist.h" | 33 #include "chrome/common/secure_origin_whitelist.h" |
| 33 #include "chrome/common/url_constants.h" | 34 #include "chrome/common/url_constants.h" |
| 34 #include "chrome/grit/generated_resources.h" | 35 #include "chrome/grit/generated_resources.h" |
| 35 #include "chrome/grit/locale_settings.h" | 36 #include "chrome/grit/locale_settings.h" |
| 36 #include "chrome/grit/renderer_resources.h" | 37 #include "chrome/grit/renderer_resources.h" |
| 37 #include "chrome/renderer/app_categorizer.h" | 38 #include "chrome/renderer/app_categorizer.h" |
| 38 #include "chrome/renderer/banners/app_banner_client.h" | 39 #include "chrome/renderer/banners/app_banner_client.h" |
| (...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 809 break; | 810 break; |
| 810 } | 811 } |
| 811 case ChromeViewHostMsg_GetPluginInfo_Status::kFlashHiddenPreferHtml: { | 812 case ChromeViewHostMsg_GetPluginInfo_Status::kFlashHiddenPreferHtml: { |
| 812 placeholder = create_blocked_plugin( | 813 placeholder = create_blocked_plugin( |
| 813 IDR_PREFER_HTML_PLUGIN_HTML, | 814 IDR_PREFER_HTML_PLUGIN_HTML, |
| 814 l10n_util::GetStringFUTF16(IDS_PLUGIN_PREFER_HTML_BY_DEFAULT, | 815 l10n_util::GetStringFUTF16(IDS_PLUGIN_PREFER_HTML_BY_DEFAULT, |
| 815 group_name)); | 816 group_name)); |
| 816 break; | 817 break; |
| 817 } | 818 } |
| 818 case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedBlocked: { | 819 case ChromeViewHostMsg_GetPluginInfo_Status::kOutdatedBlocked: { |
| 819 #if defined(ENABLE_PLUGIN_INSTALLATION) | 820 #if BUILDFLAG(ENABLE_PLUGIN_INSTALLATION) |
| 820 placeholder = create_blocked_plugin( | 821 placeholder = create_blocked_plugin( |
| 821 IDR_BLOCKED_PLUGIN_HTML, | 822 IDR_BLOCKED_PLUGIN_HTML, |
| 822 l10n_util::GetStringFUTF16(IDS_PLUGIN_OUTDATED, group_name)); | 823 l10n_util::GetStringFUTF16(IDS_PLUGIN_OUTDATED, group_name)); |
| 823 placeholder->AllowLoading(); | 824 placeholder->AllowLoading(); |
| 824 render_frame->Send(new ChromeViewHostMsg_BlockedOutdatedPlugin( | 825 render_frame->Send(new ChromeViewHostMsg_BlockedOutdatedPlugin( |
| 825 render_frame->GetRoutingID(), placeholder->CreateRoutingId(), | 826 render_frame->GetRoutingID(), placeholder->CreateRoutingId(), |
| 826 identifier)); | 827 identifier)); |
| 827 #else | 828 #else |
| 828 NOTREACHED(); | 829 NOTREACHED(); |
| 829 #endif | 830 #endif |
| (...skipping 640 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1470 | 1471 |
| 1471 url::Replacements<char> r; | 1472 url::Replacements<char> r; |
| 1472 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1473 r.SetPath(path.c_str(), url::Component(0, path.length())); |
| 1473 | 1474 |
| 1474 if (result == internal::NUM_PLUGIN_ERROR) | 1475 if (result == internal::NUM_PLUGIN_ERROR) |
| 1475 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1476 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
| 1476 | 1477 |
| 1477 RecordYouTubeRewriteUMA(result); | 1478 RecordYouTubeRewriteUMA(result); |
| 1478 return corrected_url.ReplaceComponents(r); | 1479 return corrected_url.ReplaceComponents(r); |
| 1479 } | 1480 } |
| OLD | NEW |