blob: fb40b4de98443544c3c5258ce6eadab579208690 [file] [log] [blame]
[email protected]22cf0092012-05-30 00:03:101// 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
3// found in the LICENSE file.
4
5#include "content/public/renderer/content_renderer_client.h"
6
jochen51265132015-05-28 07:33:457#include "content/public/renderer/media_stream_renderer_factory.h"
xhwang6fa356202014-12-11 00:44:128#include "media/base/renderer_factory.h"
ccameron41495f252016-09-02 02:37:329#include "ui/gfx/icc_profile.h"
kdsilvae0135592016-08-09 17:08:1110#include "url/gurl.h"
jbroman73e9f7962014-10-30 00:43:4511
[email protected]22cf0092012-05-30 00:03:1012namespace content {
13
14SkBitmap* ContentRendererClient::GetSadPluginBitmap() {
jbroman73e9f7962014-10-30 00:43:4515 return nullptr;
[email protected]22cf0092012-05-30 00:03:1016}
17
[email protected]d4d54b32012-11-19 16:14:4418SkBitmap* ContentRendererClient::GetSadWebViewBitmap() {
jbroman73e9f7962014-10-30 00:43:4519 return nullptr;
20}
21
[email protected]22cf0092012-05-30 00:03:1022bool ContentRendererClient::OverrideCreatePlugin(
[email protected]271ff5792013-12-04 22:29:3123 RenderFrame* render_frame,
[email protected]a41dec92014-04-12 02:47:5224 blink::WebLocalFrame* frame,
[email protected]180ef242013-11-07 06:50:4625 const blink::WebPluginParams& params,
26 blink::WebPlugin** plugin) {
[email protected]22cf0092012-05-30 00:03:1027 return false;
28}
29
[email protected]180ef242013-11-07 06:50:4630blink::WebPlugin* ContentRendererClient::CreatePluginReplacement(
[email protected]271ff5792013-12-04 22:29:3131 RenderFrame* render_frame,
[email protected]a3ef4832013-02-02 05:12:3332 const base::FilePath& plugin_path) {
jbroman73e9f7962014-10-30 00:43:4533 return nullptr;
[email protected]22cf0092012-05-30 00:03:1034}
35
36bool ContentRendererClient::HasErrorPage(int http_status_code,
37 std::string* error_domain) {
38 return false;
39}
40
[email protected]24a57cc2014-01-10 22:45:3041bool ContentRendererClient::ShouldSuppressErrorPage(RenderFrame* render_frame,
42 const GURL& url) {
[email protected]2309e912013-10-01 01:33:3043 return false;
44}
45
dalecurtis0f9e7f4c2015-08-19 00:12:5546void ContentRendererClient::DeferMediaLoad(
47 RenderFrame* render_frame,
48 bool has_played_media_before,
49 const base::Closure& closure) {
[email protected]d726eddc2013-07-02 22:25:5550 closure.Run();
[email protected]22cf0092012-05-30 00:03:1051}
52
[email protected]180ef242013-11-07 06:50:4653blink::WebMediaStreamCenter*
[email protected]68e5fee2013-02-18 10:04:2254ContentRendererClient::OverrideCreateWebMediaStreamCenter(
[email protected]180ef242013-11-07 06:50:4655 blink::WebMediaStreamCenterClient* client) {
jbroman73e9f7962014-10-30 00:43:4556 return nullptr;
[email protected]68e5fee2013-02-18 10:04:2257}
58
[email protected]180ef242013-11-07 06:50:4659blink::WebRTCPeerConnectionHandler*
[email protected]68e5fee2013-02-18 10:04:2260ContentRendererClient::OverrideCreateWebRTCPeerConnectionHandler(
[email protected]180ef242013-11-07 06:50:4661 blink::WebRTCPeerConnectionHandlerClient* client) {
jbroman73e9f7962014-10-30 00:43:4562 return nullptr;
[email protected]68e5fee2013-02-18 10:04:2263}
64
[email protected]180ef242013-11-07 06:50:4665blink::WebMIDIAccessor*
[email protected]fb0ab0d2013-06-26 19:29:2166ContentRendererClient::OverrideCreateMIDIAccessor(
[email protected]180ef242013-11-07 06:50:4667 blink::WebMIDIAccessorClient* client) {
jbroman73e9f7962014-10-30 00:43:4568 return nullptr;
[email protected]fb0ab0d2013-06-26 19:29:2169}
70
[email protected]180ef242013-11-07 06:50:4671blink::WebAudioDevice*
[email protected]f065ec52013-07-13 09:55:5472ContentRendererClient::OverrideCreateAudioDevice(
73 double sample_rate) {
jbroman73e9f7962014-10-30 00:43:4574 return nullptr;
[email protected]f065ec52013-07-13 09:55:5475}
76
[email protected]180ef242013-11-07 06:50:4677blink::WebClipboard* ContentRendererClient::OverrideWebClipboard() {
jbroman73e9f7962014-10-30 00:43:4578 return nullptr;
[email protected]9671a312013-02-23 06:27:3779}
80
[email protected]180ef242013-11-07 06:50:4681blink::WebThemeEngine* ContentRendererClient::OverrideThemeEngine() {
jbroman73e9f7962014-10-30 00:43:4582 return nullptr;
[email protected]60fe46e02013-03-20 19:49:5683}
84
[email protected]180ef242013-11-07 06:50:4685blink::WebSpeechSynthesizer* ContentRendererClient::OverrideSpeechSynthesizer(
86 blink::WebSpeechSynthesizerClient* client) {
jbroman73e9f7962014-10-30 00:43:4587 return nullptr;
[email protected]7a06d282013-05-03 04:39:3388}
89
[email protected]22cf0092012-05-30 00:03:1090bool ContentRendererClient::RunIdleHandlerWhenWidgetsHidden() {
[email protected]29cd1102014-07-25 04:16:0091 return true;
[email protected]22cf0092012-05-30 00:03:1092}
93
jdduke73220f02015-09-04 17:03:5194bool ContentRendererClient::AllowTimerSuspensionWhenProcessBackgrounded() {
95 return false;
96}
97
[email protected]434bc9b2012-11-27 21:22:1498bool ContentRendererClient::AllowPopup() {
[email protected]22cf0092012-05-30 00:03:1099 return false;
100}
101
dalecurtisae9adb72016-03-29 19:02:25102#if defined(OS_ANDROID)
gsennton68afca72016-01-12 11:07:32103bool ContentRendererClient::HandleNavigation(
104 RenderFrame* render_frame,
105 bool is_content_initiated,
nickf7b38222016-11-22 21:59:35106 bool render_view_was_created_by_renderer,
gsennton68afca72016-01-12 11:07:32107 blink::WebFrame* frame,
108 const blink::WebURLRequest& request,
109 blink::WebNavigationType type,
110 blink::WebNavigationPolicy default_policy,
111 bool is_redirect) {
112 return false;
113}
dalecurtisae9adb72016-03-29 19:02:25114
115bool ContentRendererClient::ShouldUseMediaPlayerForURL(const GURL& url) {
116 return false;
117}
gsennton68afca72016-01-12 11:07:32118#endif
119
alexmos49cf11a2015-06-08 22:57:35120bool ContentRendererClient::ShouldFork(blink::WebLocalFrame* frame,
[email protected]22cf0092012-05-30 00:03:10121 const GURL& url,
[email protected]c5dec6292013-01-25 04:54:52122 const std::string& http_method,
[email protected]22cf0092012-05-30 00:03:10123 bool is_initial_navigation,
[email protected]b0a29f22013-05-30 23:00:09124 bool is_server_redirect,
[email protected]22cf0092012-05-30 00:03:10125 bool* send_referrer) {
126 return false;
127}
128
dcheng5a2307c2016-12-30 13:35:10129bool ContentRendererClient::WillSendRequest(blink::WebLocalFrame* frame,
130 ui::PageTransition transition_type,
131 const blink::WebURL& url,
132 GURL* new_url) {
[email protected]22cf0092012-05-30 00:03:10133 return false;
134}
135
droger308308a2016-09-12 12:38:50136bool ContentRendererClient::IsPrefetchOnly(
137 RenderFrame* render_frame,
138 const blink::WebURLRequest& request) {
139 return false;
140}
141
[email protected]22cf0092012-05-30 00:03:10142unsigned long long ContentRendererClient::VisitedLinkHash(
143 const char* canonical_url, size_t length) {
144 return 0LL;
145}
146
147bool ContentRendererClient::IsLinkVisited(unsigned long long link_hash) {
148 return false;
149}
150
[email protected]180ef242013-11-07 06:50:46151blink::WebPrescientNetworking*
[email protected]b1e7562d2013-05-27 05:47:53152ContentRendererClient::GetPrescientNetworking() {
jbroman73e9f7962014-10-30 00:43:45153 return nullptr;
[email protected]b1e7562d2013-05-27 05:47:53154}
155
[email protected]22cf0092012-05-30 00:03:10156bool ContentRendererClient::ShouldOverridePageVisibilityState(
[email protected]b849847b2013-12-10 21:57:58157 const RenderFrame* render_frame,
[email protected]180ef242013-11-07 06:50:46158 blink::WebPageVisibilityState* override_state) {
[email protected]22cf0092012-05-30 00:03:10159 return false;
160}
161
[email protected]b66bbbc52013-08-09 20:07:02162bool ContentRendererClient::IsExternalPepperPlugin(
163 const std::string& module_name) {
164 return false;
165}
166
[email protected]b66bbbc52013-08-09 20:07:02167bool ContentRendererClient::AllowPepperMediaStreamAPI(const GURL& url) {
[email protected]24fe6122013-06-18 21:48:28168 return false;
169}
170
halliwell94bc33f2016-04-22 04:08:55171void ContentRendererClient::AddSupportedKeySystems(
172 std::vector<std::unique_ptr<media::KeySystemProperties>>* key_systems) {}
173
dcheng6003e0b2016-04-09 18:42:34174std::unique_ptr<MediaStreamRendererFactory>
jochen51265132015-05-28 07:33:45175ContentRendererClient::CreateMediaStreamRendererFactory() {
176 return nullptr;
177}
178
ccameron41495f252016-09-02 02:37:32179std::unique_ptr<gfx::ICCProfile>
180ContentRendererClient::GetImageDecodeColorProfile() {
181 return nullptr;
182}
183
[email protected]fd8eb742013-08-22 00:42:00184bool ContentRendererClient::ShouldReportDetailedMessageForSource(
185 const base::string16& source) const {
186 return false;
187}
188
nick88299ba2015-06-16 23:57:41189bool ContentRendererClient::ShouldGatherSiteIsolationStats() const {
[email protected]55dd9332013-09-04 17:17:50190 return true;
191}
192
mlamouria5b294552015-03-09 16:16:36193blink::WebWorkerContentSettingsClientProxy*
194ContentRendererClient::CreateWorkerContentSettingsClientProxy(
[email protected]a86c0e962013-12-17 17:10:39195 RenderFrame* render_frame, blink::WebFrame* frame) {
jbroman73e9f7962014-10-30 00:43:45196 return nullptr;
[email protected]44fb3fe2013-11-01 05:38:17197}
198
jchuang586e3db2015-02-25 05:17:56199bool ContentRendererClient::IsPluginAllowedToUseCameraDeviceAPI(
200 const GURL& url) {
201 return false;
202}
203
[email protected]72630d52014-07-07 21:30:21204bool ContentRendererClient::IsPluginAllowedToUseCompositorAPI(const GURL& url) {
205 return false;
206}
207
[email protected]72630d52014-07-07 21:30:21208bool ContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() {
209 return false;
210}
211
lazyboyabce7812014-09-06 13:22:51212BrowserPluginDelegate* ContentRendererClient::CreateBrowserPluginDelegate(
213 RenderFrame* render_frame,
raymes976549372014-11-07 01:26:22214 const std::string& mime_type,
215 const GURL& original_url) {
jbroman73e9f7962014-10-30 00:43:45216 return nullptr;
lazyboyabce7812014-09-06 13:22:51217}
218
guoweisa1ccdf212015-09-29 18:24:19219bool ContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() {
220 return true;
221}
222
kdsilvae0135592016-08-09 17:08:11223GURL ContentRendererClient::OverrideFlashEmbedWithHTML(const GURL& url) {
224 return GURL();
225}
226
jameswest451a5bb2017-01-27 03:59:39227bool ContentRendererClient::AllowMediaSuspend() {
228 return true;
229}
230
[email protected]22cf0092012-05-30 00:03:10231} // namespace content