blob: 06afdb74780287a1080fc5f774e745919ba9edb7 [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"
altimineb6bd1962017-05-03 14:52:389#include "third_party/WebKit/public/platform/WebAudioDevice.h"
10#include "third_party/WebKit/public/platform/WebMediaStreamCenter.h"
11#include "third_party/WebKit/public/platform/WebRTCPeerConnectionHandler.h"
12#include "third_party/WebKit/public/platform/WebSpeechSynthesizer.h"
13#include "third_party/WebKit/public/platform/modules/webmidi/WebMIDIAccessor.h"
ccameron41495f252016-09-02 02:37:3214#include "ui/gfx/icc_profile.h"
kdsilvae0135592016-08-09 17:08:1115#include "url/gurl.h"
jbroman73e9f7962014-10-30 00:43:4516
[email protected]22cf0092012-05-30 00:03:1017namespace content {
18
19SkBitmap* ContentRendererClient::GetSadPluginBitmap() {
jbroman73e9f7962014-10-30 00:43:4520 return nullptr;
[email protected]22cf0092012-05-30 00:03:1021}
22
[email protected]d4d54b32012-11-19 16:14:4423SkBitmap* ContentRendererClient::GetSadWebViewBitmap() {
jbroman73e9f7962014-10-30 00:43:4524 return nullptr;
25}
26
[email protected]22cf0092012-05-30 00:03:1027bool ContentRendererClient::OverrideCreatePlugin(
[email protected]271ff5792013-12-04 22:29:3128 RenderFrame* render_frame,
[email protected]180ef242013-11-07 06:50:4629 const blink::WebPluginParams& params,
30 blink::WebPlugin** plugin) {
[email protected]22cf0092012-05-30 00:03:1031 return false;
32}
33
[email protected]180ef242013-11-07 06:50:4634blink::WebPlugin* ContentRendererClient::CreatePluginReplacement(
[email protected]271ff5792013-12-04 22:29:3135 RenderFrame* render_frame,
[email protected]a3ef4832013-02-02 05:12:3336 const base::FilePath& plugin_path) {
jbroman73e9f7962014-10-30 00:43:4537 return nullptr;
[email protected]22cf0092012-05-30 00:03:1038}
39
40bool ContentRendererClient::HasErrorPage(int http_status_code,
41 std::string* error_domain) {
42 return false;
43}
44
[email protected]24a57cc2014-01-10 22:45:3045bool ContentRendererClient::ShouldSuppressErrorPage(RenderFrame* render_frame,
46 const GURL& url) {
[email protected]2309e912013-10-01 01:33:3047 return false;
48}
49
dalecurtis0f9e7f4c2015-08-19 00:12:5550void ContentRendererClient::DeferMediaLoad(
51 RenderFrame* render_frame,
52 bool has_played_media_before,
53 const base::Closure& closure) {
[email protected]d726eddc2013-07-02 22:25:5554 closure.Run();
[email protected]22cf0092012-05-30 00:03:1055}
56
altimineb6bd1962017-05-03 14:52:3857std::unique_ptr<blink::WebMediaStreamCenter>
[email protected]68e5fee2013-02-18 10:04:2258ContentRendererClient::OverrideCreateWebMediaStreamCenter(
[email protected]180ef242013-11-07 06:50:4659 blink::WebMediaStreamCenterClient* client) {
jbroman73e9f7962014-10-30 00:43:4560 return nullptr;
[email protected]68e5fee2013-02-18 10:04:2261}
62
altimineb6bd1962017-05-03 14:52:3863std::unique_ptr<blink::WebRTCPeerConnectionHandler>
[email protected]68e5fee2013-02-18 10:04:2264ContentRendererClient::OverrideCreateWebRTCPeerConnectionHandler(
[email protected]180ef242013-11-07 06:50:4665 blink::WebRTCPeerConnectionHandlerClient* client) {
jbroman73e9f7962014-10-30 00:43:4566 return nullptr;
[email protected]68e5fee2013-02-18 10:04:2267}
68
altimineb6bd1962017-05-03 14:52:3869std::unique_ptr<blink::WebMIDIAccessor>
[email protected]fb0ab0d2013-06-26 19:29:2170ContentRendererClient::OverrideCreateMIDIAccessor(
[email protected]180ef242013-11-07 06:50:4671 blink::WebMIDIAccessorClient* client) {
jbroman73e9f7962014-10-30 00:43:4572 return nullptr;
[email protected]fb0ab0d2013-06-26 19:29:2173}
74
altimineb6bd1962017-05-03 14:52:3875std::unique_ptr<blink::WebAudioDevice>
76ContentRendererClient::OverrideCreateAudioDevice(
andrew.macpherson67c41de12017-04-17 19:45:2977 const blink::WebAudioLatencyHint& latency_hint) {
jbroman73e9f7962014-10-30 00:43:4578 return nullptr;
[email protected]f065ec52013-07-13 09:55:5479}
80
[email protected]180ef242013-11-07 06:50:4681blink::WebClipboard* ContentRendererClient::OverrideWebClipboard() {
jbroman73e9f7962014-10-30 00:43:4582 return nullptr;
[email protected]9671a312013-02-23 06:27:3783}
84
[email protected]180ef242013-11-07 06:50:4685blink::WebThemeEngine* ContentRendererClient::OverrideThemeEngine() {
jbroman73e9f7962014-10-30 00:43:4586 return nullptr;
[email protected]60fe46e02013-03-20 19:49:5687}
88
altimineb6bd1962017-05-03 14:52:3889std::unique_ptr<blink::WebSpeechSynthesizer>
90ContentRendererClient::OverrideSpeechSynthesizer(
[email protected]180ef242013-11-07 06:50:4691 blink::WebSpeechSynthesizerClient* client) {
jbroman73e9f7962014-10-30 00:43:4592 return nullptr;
[email protected]7a06d282013-05-03 04:39:3393}
94
[email protected]22cf0092012-05-30 00:03:1095bool ContentRendererClient::RunIdleHandlerWhenWidgetsHidden() {
[email protected]29cd1102014-07-25 04:16:0096 return true;
[email protected]22cf0092012-05-30 00:03:1097}
98
jdduke73220f02015-09-04 17:03:5199bool ContentRendererClient::AllowTimerSuspensionWhenProcessBackgrounded() {
100 return false;
101}
102
[email protected]434bc9b2012-11-27 21:22:14103bool ContentRendererClient::AllowPopup() {
[email protected]22cf0092012-05-30 00:03:10104 return false;
105}
106
dalecurtisae9adb72016-03-29 19:02:25107#if defined(OS_ANDROID)
gsennton68afca72016-01-12 11:07:32108bool ContentRendererClient::HandleNavigation(
109 RenderFrame* render_frame,
110 bool is_content_initiated,
nickf7b38222016-11-22 21:59:35111 bool render_view_was_created_by_renderer,
gsennton68afca72016-01-12 11:07:32112 blink::WebFrame* frame,
113 const blink::WebURLRequest& request,
114 blink::WebNavigationType type,
115 blink::WebNavigationPolicy default_policy,
116 bool is_redirect) {
117 return false;
118}
dalecurtisae9adb72016-03-29 19:02:25119
120bool ContentRendererClient::ShouldUseMediaPlayerForURL(const GURL& url) {
121 return false;
122}
gsennton68afca72016-01-12 11:07:32123#endif
124
alexmos49cf11a2015-06-08 22:57:35125bool ContentRendererClient::ShouldFork(blink::WebLocalFrame* frame,
[email protected]22cf0092012-05-30 00:03:10126 const GURL& url,
[email protected]c5dec6292013-01-25 04:54:52127 const std::string& http_method,
[email protected]22cf0092012-05-30 00:03:10128 bool is_initial_navigation,
[email protected]b0a29f22013-05-30 23:00:09129 bool is_server_redirect,
[email protected]22cf0092012-05-30 00:03:10130 bool* send_referrer) {
131 return false;
132}
133
yzshen2d8fb422017-06-01 20:29:40134bool ContentRendererClient::WillSendRequest(
135 blink::WebLocalFrame* frame,
136 ui::PageTransition transition_type,
137 const blink::WebURL& url,
138 std::vector<std::unique_ptr<URLLoaderThrottle>>* throttles,
139 GURL* new_url) {
[email protected]22cf0092012-05-30 00:03:10140 return false;
141}
142
droger308308a2016-09-12 12:38:50143bool ContentRendererClient::IsPrefetchOnly(
144 RenderFrame* render_frame,
145 const blink::WebURLRequest& request) {
146 return false;
147}
148
[email protected]22cf0092012-05-30 00:03:10149unsigned long long ContentRendererClient::VisitedLinkHash(
150 const char* canonical_url, size_t length) {
151 return 0LL;
152}
153
154bool ContentRendererClient::IsLinkVisited(unsigned long long link_hash) {
155 return false;
156}
157
[email protected]180ef242013-11-07 06:50:46158blink::WebPrescientNetworking*
[email protected]b1e7562d2013-05-27 05:47:53159ContentRendererClient::GetPrescientNetworking() {
jbroman73e9f7962014-10-30 00:43:45160 return nullptr;
[email protected]b1e7562d2013-05-27 05:47:53161}
162
[email protected]22cf0092012-05-30 00:03:10163bool ContentRendererClient::ShouldOverridePageVisibilityState(
[email protected]b849847b2013-12-10 21:57:58164 const RenderFrame* render_frame,
[email protected]180ef242013-11-07 06:50:46165 blink::WebPageVisibilityState* override_state) {
[email protected]22cf0092012-05-30 00:03:10166 return false;
167}
168
[email protected]b66bbbc52013-08-09 20:07:02169bool ContentRendererClient::IsExternalPepperPlugin(
170 const std::string& module_name) {
171 return false;
172}
173
[email protected]b66bbbc52013-08-09 20:07:02174bool ContentRendererClient::AllowPepperMediaStreamAPI(const GURL& url) {
[email protected]24fe6122013-06-18 21:48:28175 return false;
176}
177
halliwell94bc33f2016-04-22 04:08:55178void ContentRendererClient::AddSupportedKeySystems(
179 std::vector<std::unique_ptr<media::KeySystemProperties>>* key_systems) {}
180
chcunningham8aeee0b52017-04-07 22:41:40181bool ContentRendererClient::IsKeySystemsUpdateNeeded() {
182 return false;
183}
184
185bool ContentRendererClient::IsSupportedAudioConfig(
186 const media::AudioConfig& config) {
187 // Defer to media's default support.
188 return ::media::IsSupportedAudioConfig(config);
189}
190
191bool ContentRendererClient::IsSupportedVideoConfig(
192 const media::VideoConfig& config) {
193 // Defer to media's default support.
194 return ::media::IsSupportedVideoConfig(config);
195}
196
tsunghung9cc516b2017-06-06 17:30:01197bool ContentRendererClient::IsSupportedBitstreamAudioCodec(
198 media::AudioCodec codec) {
199 return false;
200}
201
dcheng6003e0b2016-04-09 18:42:34202std::unique_ptr<MediaStreamRendererFactory>
jochen51265132015-05-28 07:33:45203ContentRendererClient::CreateMediaStreamRendererFactory() {
204 return nullptr;
205}
206
[email protected]fd8eb742013-08-22 00:42:00207bool ContentRendererClient::ShouldReportDetailedMessageForSource(
208 const base::string16& source) const {
209 return false;
210}
211
nick88299ba2015-06-16 23:57:41212bool ContentRendererClient::ShouldGatherSiteIsolationStats() const {
[email protected]55dd9332013-09-04 17:17:50213 return true;
214}
215
Hiroki Nakagawa6bcbd1902017-06-09 07:13:20216std::unique_ptr<blink::WebContentSettingsClient>
217ContentRendererClient::CreateWorkerContentSettingsClient(
218 RenderFrame* render_frame,
219 blink::WebFrame* frame) {
jbroman73e9f7962014-10-30 00:43:45220 return nullptr;
[email protected]44fb3fe2013-11-01 05:38:17221}
222
jchuang586e3db2015-02-25 05:17:56223bool ContentRendererClient::IsPluginAllowedToUseCameraDeviceAPI(
224 const GURL& url) {
225 return false;
226}
227
[email protected]72630d52014-07-07 21:30:21228bool ContentRendererClient::IsPluginAllowedToUseCompositorAPI(const GURL& url) {
229 return false;
230}
231
[email protected]72630d52014-07-07 21:30:21232bool ContentRendererClient::IsPluginAllowedToUseDevChannelAPIs() {
233 return false;
234}
235
lazyboyabce7812014-09-06 13:22:51236BrowserPluginDelegate* ContentRendererClient::CreateBrowserPluginDelegate(
237 RenderFrame* render_frame,
raymes976549372014-11-07 01:26:22238 const std::string& mime_type,
239 const GURL& original_url) {
jbroman73e9f7962014-10-30 00:43:45240 return nullptr;
lazyboyabce7812014-09-06 13:22:51241}
242
guoweisa1ccdf212015-09-29 18:24:19243bool ContentRendererClient::ShouldEnforceWebRTCRoutingPreferences() {
244 return true;
245}
246
kdsilvae0135592016-08-09 17:08:11247GURL ContentRendererClient::OverrideFlashEmbedWithHTML(const GURL& url) {
248 return GURL();
249}
250
fdoraya70d7172017-04-04 20:52:20251std::unique_ptr<base::TaskScheduler::InitParams>
252ContentRendererClient::GetTaskSchedulerInitParams() {
253 return nullptr;
254}
255
jameswest451a5bb2017-01-27 03:59:39256bool ContentRendererClient::AllowMediaSuspend() {
257 return true;
258}
259
[email protected]22cf0092012-05-30 00:03:10260} // namespace content