| 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/bind.h" | 10 #include "base/bind.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "base/time/time.h" | 21 #include "base/time/time.h" |
| 22 #include "base/values.h" | 22 #include "base/values.h" |
| 23 #include "build/build_config.h" | 23 #include "build/build_config.h" |
| 24 #include "chrome/common/channel_info.h" | 24 #include "chrome/common/channel_info.h" |
| 25 #include "chrome/common/chrome_features.h" | 25 #include "chrome/common/chrome_features.h" |
| 26 #include "chrome/common/chrome_isolated_world_ids.h" | 26 #include "chrome/common/chrome_isolated_world_ids.h" |
| 27 #include "chrome/common/chrome_paths.h" | 27 #include "chrome/common/chrome_paths.h" |
| 28 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 29 #include "chrome/common/crash_keys.h" | 29 #include "chrome/common/crash_keys.h" |
| 30 #include "chrome/common/features.h" | 30 #include "chrome/common/features.h" |
| 31 #include "chrome/common/pause_tabs_field_trial.h" | |
| 32 #include "chrome/common/pepper_permission_util.h" | 31 #include "chrome/common/pepper_permission_util.h" |
| 33 #include "chrome/common/prerender_types.h" | 32 #include "chrome/common/prerender_types.h" |
| 34 #include "chrome/common/render_messages.h" | 33 #include "chrome/common/render_messages.h" |
| 35 #include "chrome/common/secure_origin_whitelist.h" | 34 #include "chrome/common/secure_origin_whitelist.h" |
| 36 #include "chrome/common/url_constants.h" | 35 #include "chrome/common/url_constants.h" |
| 37 #include "chrome/grit/chromium_strings.h" | 36 #include "chrome/grit/chromium_strings.h" |
| 38 #include "chrome/grit/generated_resources.h" | 37 #include "chrome/grit/generated_resources.h" |
| 39 #include "chrome/grit/locale_settings.h" | 38 #include "chrome/grit/locale_settings.h" |
| 40 #include "chrome/grit/renderer_resources.h" | 39 #include "chrome/grit/renderer_resources.h" |
| 41 #include "chrome/renderer/app_categorizer.h" | 40 #include "chrome/renderer/app_categorizer.h" |
| (...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1091 } | 1090 } |
| 1092 | 1091 |
| 1093 bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { | 1092 bool ChromeContentRendererClient::RunIdleHandlerWhenWidgetsHidden() { |
| 1094 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1093 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 1095 return !IsStandaloneExtensionProcess(); | 1094 return !IsStandaloneExtensionProcess(); |
| 1096 #else | 1095 #else |
| 1097 return true; | 1096 return true; |
| 1098 #endif | 1097 #endif |
| 1099 } | 1098 } |
| 1100 | 1099 |
| 1101 bool ChromeContentRendererClient:: | |
| 1102 AllowTimerSuspensionWhenProcessBackgrounded() { | |
| 1103 #if defined(OS_ANDROID) | |
| 1104 return true; | |
| 1105 #else | |
| 1106 // TODO(ojan): Plumb the engagement values for this feature to WebViewImpl. | |
| 1107 return base::FeatureList::IsEnabled(pausetabs::kFeature); | |
| 1108 #endif | |
| 1109 } | |
| 1110 | |
| 1111 bool ChromeContentRendererClient::AllowPopup() { | 1100 bool ChromeContentRendererClient::AllowPopup() { |
| 1112 #if BUILDFLAG(ENABLE_EXTENSIONS) | 1101 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 1113 return ChromeExtensionsRendererClient::GetInstance()->AllowPopup(); | 1102 return ChromeExtensionsRendererClient::GetInstance()->AllowPopup(); |
| 1114 #else | 1103 #else |
| 1115 return false; | 1104 return false; |
| 1116 #endif | 1105 #endif |
| 1117 } | 1106 } |
| 1118 | 1107 |
| 1119 bool ChromeContentRendererClient::ShouldFork(WebLocalFrame* frame, | 1108 bool ChromeContentRendererClient::ShouldFork(WebLocalFrame* frame, |
| 1120 const GURL& url, | 1109 const GURL& url, |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1551 | 1540 |
| 1552 RecordYouTubeRewriteUMA(result); | 1541 RecordYouTubeRewriteUMA(result); |
| 1553 return corrected_url.ReplaceComponents(r); | 1542 return corrected_url.ReplaceComponents(r); |
| 1554 } | 1543 } |
| 1555 | 1544 |
| 1556 std::unique_ptr<base::TaskScheduler::InitParams> | 1545 std::unique_ptr<base::TaskScheduler::InitParams> |
| 1557 ChromeContentRendererClient::GetTaskSchedulerInitParams() { | 1546 ChromeContentRendererClient::GetTaskSchedulerInitParams() { |
| 1558 return task_scheduler_util:: | 1547 return task_scheduler_util:: |
| 1559 GetRendererTaskSchedulerInitParamsFromCommandLine(); | 1548 GetRendererTaskSchedulerInitParamsFromCommandLine(); |
| 1560 } | 1549 } |
| OLD | NEW |