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/pepper_permission_util.h" | 29 #include "chrome/common/pepper_permission_util.h" |
| 30 #include "chrome/common/prerender_types.h" |
30 #include "chrome/common/render_messages.h" | 31 #include "chrome/common/render_messages.h" |
31 #include "chrome/common/secure_origin_whitelist.h" | 32 #include "chrome/common/secure_origin_whitelist.h" |
32 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" |
33 #include "chrome/grit/generated_resources.h" | 34 #include "chrome/grit/generated_resources.h" |
34 #include "chrome/grit/locale_settings.h" | 35 #include "chrome/grit/locale_settings.h" |
35 #include "chrome/grit/renderer_resources.h" | 36 #include "chrome/grit/renderer_resources.h" |
36 #include "chrome/renderer/app_categorizer.h" | 37 #include "chrome/renderer/app_categorizer.h" |
37 #include "chrome/renderer/banners/app_banner_client.h" | 38 #include "chrome/renderer/banners/app_banner_client.h" |
38 #include "chrome/renderer/benchmarking_extension.h" | 39 #include "chrome/renderer/benchmarking_extension.h" |
39 #include "chrome/renderer/chrome_render_frame_observer.h" | 40 #include "chrome/renderer/chrome_render_frame_observer.h" |
(...skipping 1099 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1139 else if (url.host() == chrome::kChromeUIThumbnailHost) | 1140 else if (url.host() == chrome::kChromeUIThumbnailHost) |
1140 type = SearchBox::THUMB; | 1141 type = SearchBox::THUMB; |
1141 | 1142 |
1142 if (type != SearchBox::NONE) | 1143 if (type != SearchBox::NONE) |
1143 return search_box->GenerateImageURLFromTransientURL(url, type, new_url); | 1144 return search_box->GenerateImageURLFromTransientURL(url, type, new_url); |
1144 } | 1145 } |
1145 | 1146 |
1146 return false; | 1147 return false; |
1147 } | 1148 } |
1148 | 1149 |
| 1150 bool ChromeContentRendererClient::IsPrefetchOnly( |
| 1151 content::RenderFrame* render_frame, |
| 1152 const blink::WebURLRequest& request) { |
| 1153 return prerender::PrerenderHelper::GetPrerenderMode(render_frame) == |
| 1154 prerender::PREFETCH_ONLY; |
| 1155 } |
| 1156 |
1149 unsigned long long ChromeContentRendererClient::VisitedLinkHash( | 1157 unsigned long long ChromeContentRendererClient::VisitedLinkHash( |
1150 const char* canonical_url, size_t length) { | 1158 const char* canonical_url, size_t length) { |
1151 return visited_link_slave_->ComputeURLFingerprint(canonical_url, length); | 1159 return visited_link_slave_->ComputeURLFingerprint(canonical_url, length); |
1152 } | 1160 } |
1153 | 1161 |
1154 bool ChromeContentRendererClient::IsLinkVisited(unsigned long long link_hash) { | 1162 bool ChromeContentRendererClient::IsLinkVisited(unsigned long long link_hash) { |
1155 return visited_link_slave_->IsVisited(link_hash); | 1163 return visited_link_slave_->IsVisited(link_hash); |
1156 } | 1164 } |
1157 | 1165 |
1158 blink::WebPrescientNetworking* | 1166 blink::WebPrescientNetworking* |
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1465 | 1473 |
1466 url::Replacements<char> r; | 1474 url::Replacements<char> r; |
1467 r.SetPath(path.c_str(), url::Component(0, path.length())); | 1475 r.SetPath(path.c_str(), url::Component(0, path.length())); |
1468 | 1476 |
1469 if (result == internal::NUM_PLUGIN_ERROR) | 1477 if (result == internal::NUM_PLUGIN_ERROR) |
1470 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; | 1478 result = invalid_url ? internal::SUCCESS_PARAMS_REWRITE : internal::SUCCESS; |
1471 | 1479 |
1472 RecordYouTubeRewriteUMA(result); | 1480 RecordYouTubeRewriteUMA(result); |
1473 return corrected_url.ReplaceComponents(r); | 1481 return corrected_url.ReplaceComponents(r); |
1474 } | 1482 } |
OLD | NEW |