Supervised user whitelists: Cleanup
[chromium-blink-merge.git] / content / public / browser / content_browser_client.cc
blob41feccb42576989a81b976720c0d67906e64c039
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
3 // found in the LICENSE file.
5 #include "content/public/browser/content_browser_client.h"
7 #include "base/files/file_path.h"
8 #include "content/public/browser/client_certificate_delegate.h"
9 #include "ui/gfx/image/image_skia.h"
10 #include "url/gurl.h"
12 namespace content {
14 BrowserMainParts* ContentBrowserClient::CreateBrowserMainParts(
15 const MainFunctionParams& parameters) {
16 return nullptr;
19 void ContentBrowserClient::PostAfterStartupTask(
20 const tracked_objects::Location& from_here,
21 const scoped_refptr<base::TaskRunner>& task_runner,
22 const base::Closure& task) {
23 task_runner->PostTask(from_here, task);
26 WebContentsViewDelegate* ContentBrowserClient::GetWebContentsViewDelegate(
27 WebContents* web_contents) {
28 return nullptr;
31 GURL ContentBrowserClient::GetEffectiveURL(BrowserContext* browser_context,
32 const GURL& url) {
33 return url;
36 bool ContentBrowserClient::ShouldUseProcessPerSite(
37 BrowserContext* browser_context, const GURL& effective_url) {
38 return false;
41 net::URLRequestContextGetter* ContentBrowserClient::CreateRequestContext(
42 BrowserContext* browser_context,
43 ProtocolHandlerMap* protocol_handlers,
44 URLRequestInterceptorScopedVector request_interceptors) {
45 return nullptr;
48 net::URLRequestContextGetter*
49 ContentBrowserClient::CreateRequestContextForStoragePartition(
50 BrowserContext* browser_context,
51 const base::FilePath& partition_path,
52 bool in_memory,
53 ProtocolHandlerMap* protocol_handlers,
54 URLRequestInterceptorScopedVector request_interceptors) {
55 return nullptr;
58 bool ContentBrowserClient::IsHandledURL(const GURL& url) {
59 return false;
62 bool ContentBrowserClient::CanCommitURL(RenderProcessHost* process_host,
63 const GURL& site_url) {
64 return true;
67 bool ContentBrowserClient::ShouldAllowOpenURL(SiteInstance* site_instance,
68 const GURL& url) {
69 return true;
72 bool ContentBrowserClient::IsSuitableHost(RenderProcessHost* process_host,
73 const GURL& site_url) {
74 return true;
77 bool ContentBrowserClient::MayReuseHost(RenderProcessHost* process_host) {
78 return true;
81 bool ContentBrowserClient::ShouldTryToUseExistingProcessHost(
82 BrowserContext* browser_context, const GURL& url) {
83 return false;
86 bool ContentBrowserClient::ShouldSwapBrowsingInstancesForNavigation(
87 SiteInstance* site_instance,
88 const GURL& current_url,
89 const GURL& new_url) {
90 return false;
93 bool ContentBrowserClient::ShouldSwapProcessesForRedirect(
94 ResourceContext* resource_context, const GURL& current_url,
95 const GURL& new_url) {
96 return false;
99 bool ContentBrowserClient::ShouldAssignSiteForURL(const GURL& url) {
100 return true;
103 std::string ContentBrowserClient::GetCanonicalEncodingNameByAliasName(
104 const std::string& alias_name) {
105 return std::string();
108 std::string ContentBrowserClient::GetApplicationLocale() {
109 return "en-US";
112 std::string ContentBrowserClient::GetAcceptLangs(BrowserContext* context) {
113 return std::string();
116 const gfx::ImageSkia* ContentBrowserClient::GetDefaultFavicon() {
117 static gfx::ImageSkia* empty = new gfx::ImageSkia();
118 return empty;
121 bool ContentBrowserClient::AllowAppCache(const GURL& manifest_url,
122 const GURL& first_party,
123 ResourceContext* context) {
124 return true;
127 bool ContentBrowserClient::AllowServiceWorker(
128 const GURL& scope,
129 const GURL& document_url,
130 content::ResourceContext* context) {
131 return true;
134 bool ContentBrowserClient::AllowGetCookie(const GURL& url,
135 const GURL& first_party,
136 const net::CookieList& cookie_list,
137 ResourceContext* context,
138 int render_process_id,
139 int render_frame_id) {
140 return true;
143 bool ContentBrowserClient::AllowSetCookie(const GURL& url,
144 const GURL& first_party,
145 const std::string& cookie_line,
146 ResourceContext* context,
147 int render_process_id,
148 int render_frame_id,
149 net::CookieOptions* options) {
150 return true;
153 bool ContentBrowserClient::AllowSaveLocalState(ResourceContext* context) {
154 return true;
157 bool ContentBrowserClient::AllowWorkerDatabase(
158 const GURL& url,
159 const base::string16& name,
160 const base::string16& display_name,
161 unsigned long estimated_size,
162 ResourceContext* context,
163 const std::vector<std::pair<int, int> >& render_frames) {
164 return true;
167 void ContentBrowserClient::AllowWorkerFileSystem(
168 const GURL& url,
169 ResourceContext* context,
170 const std::vector<std::pair<int, int> >& render_frames,
171 base::Callback<void(bool)> callback) {
172 callback.Run(true);
175 bool ContentBrowserClient::AllowWorkerIndexedDB(
176 const GURL& url,
177 const base::string16& name,
178 ResourceContext* context,
179 const std::vector<std::pair<int, int> >& render_frames) {
180 return true;
183 QuotaPermissionContext* ContentBrowserClient::CreateQuotaPermissionContext() {
184 return nullptr;
187 void ContentBrowserClient::SelectClientCertificate(
188 WebContents* web_contents,
189 net::SSLCertRequestInfo* cert_request_info,
190 scoped_ptr<ClientCertificateDelegate> delegate) {
193 net::URLRequestContext* ContentBrowserClient::OverrideRequestContextForURL(
194 const GURL& url, ResourceContext* context) {
195 return nullptr;
198 std::string ContentBrowserClient::GetStoragePartitionIdForSite(
199 BrowserContext* browser_context,
200 const GURL& site) {
201 return std::string();
204 bool ContentBrowserClient::IsValidStoragePartitionId(
205 BrowserContext* browser_context,
206 const std::string& partition_id) {
207 // Since the GetStoragePartitionIdForChildProcess() only generates empty
208 // strings, we should only ever see empty strings coming back.
209 return partition_id.empty();
212 void ContentBrowserClient::GetStoragePartitionConfigForSite(
213 BrowserContext* browser_context,
214 const GURL& site,
215 bool can_be_default,
216 std::string* partition_domain,
217 std::string* partition_name,
218 bool* in_memory) {
219 partition_domain->clear();
220 partition_name->clear();
221 *in_memory = false;
224 MediaObserver* ContentBrowserClient::GetMediaObserver() {
225 return nullptr;
228 PlatformNotificationService*
229 ContentBrowserClient::GetPlatformNotificationService() {
230 return nullptr;
233 bool ContentBrowserClient::CanCreateWindow(
234 const GURL& opener_url,
235 const GURL& opener_top_level_frame_url,
236 const GURL& source_origin,
237 WindowContainerType container_type,
238 const GURL& target_url,
239 const Referrer& referrer,
240 WindowOpenDisposition disposition,
241 const blink::WebWindowFeatures& features,
242 bool user_gesture,
243 bool opener_suppressed,
244 ResourceContext* context,
245 int render_process_id,
246 int opener_id,
247 bool* no_javascript_access) {
248 *no_javascript_access = false;
249 return true;
252 SpeechRecognitionManagerDelegate*
253 ContentBrowserClient::CreateSpeechRecognitionManagerDelegate() {
254 return nullptr;
257 net::NetLog* ContentBrowserClient::GetNetLog() {
258 return nullptr;
261 AccessTokenStore* ContentBrowserClient::CreateAccessTokenStore() {
262 return nullptr;
265 bool ContentBrowserClient::IsFastShutdownPossible() {
266 return true;
269 base::FilePath ContentBrowserClient::GetDefaultDownloadDirectory() {
270 return base::FilePath();
273 std::string ContentBrowserClient::GetDefaultDownloadName() {
274 return std::string();
277 BrowserPpapiHost*
278 ContentBrowserClient::GetExternalBrowserPpapiHost(int plugin_process_id) {
279 return nullptr;
282 bool ContentBrowserClient::AllowPepperSocketAPI(
283 BrowserContext* browser_context,
284 const GURL& url,
285 bool private_api,
286 const SocketPermissionRequest* params) {
287 return false;
290 ui::SelectFilePolicy* ContentBrowserClient::CreateSelectFilePolicy(
291 WebContents* web_contents) {
292 return nullptr;
295 LocationProvider* ContentBrowserClient::OverrideSystemLocationProvider() {
296 return nullptr;
299 DevToolsManagerDelegate* ContentBrowserClient::GetDevToolsManagerDelegate() {
300 return nullptr;
303 TracingDelegate* ContentBrowserClient::GetTracingDelegate() {
304 return nullptr;
307 bool ContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle(
308 BrowserContext* browser_context,
309 const GURL& url) {
310 return false;
313 bool ContentBrowserClient::IsPluginAllowedToUseDevChannelAPIs(
314 BrowserContext* browser_context,
315 const GURL& url) {
316 return false;
319 bool ContentBrowserClient::CheckMediaAccessPermission(
320 BrowserContext* browser_context,
321 const GURL& security_origin,
322 MediaStreamType type) {
323 return false;
326 PresentationServiceDelegate*
327 ContentBrowserClient::GetPresentationServiceDelegate(
328 WebContents* web_contents) {
329 return nullptr;
332 void ContentBrowserClient::OpenURL(
333 content::BrowserContext* browser_context,
334 const content::OpenURLParams& params,
335 const base::Callback<void(content::WebContents*)>& callback) {
336 callback.Run(nullptr);
339 #if defined(OS_WIN)
340 const wchar_t* ContentBrowserClient::GetResourceDllName() {
341 return nullptr;
343 #endif
345 #if defined(VIDEO_HOLE)
346 ExternalVideoSurfaceContainer*
347 ContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer(
348 WebContents* web_contents) {
349 return nullptr;
351 #endif
353 } // namespace content