ozone: evdev: Sync caps lock LED state to evdev
[chromium-blink-merge.git] / content / public / browser / content_browser_client.cc
blob96c076a602de161ea5e0fb2a3a789d3ab8d9e315
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 "ui/gfx/image/image_skia.h"
9 #include "url/gurl.h"
11 namespace content {
13 BrowserMainParts* ContentBrowserClient::CreateBrowserMainParts(
14 const MainFunctionParams& parameters) {
15 return nullptr;
18 WebContentsViewDelegate* ContentBrowserClient::GetWebContentsViewDelegate(
19 WebContents* web_contents) {
20 return nullptr;
23 GURL ContentBrowserClient::GetEffectiveURL(BrowserContext* browser_context,
24 const GURL& url) {
25 return url;
28 bool ContentBrowserClient::ShouldUseProcessPerSite(
29 BrowserContext* browser_context, const GURL& effective_url) {
30 return false;
33 net::URLRequestContextGetter* ContentBrowserClient::CreateRequestContext(
34 BrowserContext* browser_context,
35 ProtocolHandlerMap* protocol_handlers,
36 URLRequestInterceptorScopedVector request_interceptors) {
37 return nullptr;
40 net::URLRequestContextGetter*
41 ContentBrowserClient::CreateRequestContextForStoragePartition(
42 BrowserContext* browser_context,
43 const base::FilePath& partition_path,
44 bool in_memory,
45 ProtocolHandlerMap* protocol_handlers,
46 URLRequestInterceptorScopedVector request_interceptors) {
47 return nullptr;
50 bool ContentBrowserClient::IsHandledURL(const GURL& url) {
51 return false;
54 bool ContentBrowserClient::CanCommitURL(RenderProcessHost* process_host,
55 const GURL& site_url) {
56 return true;
59 bool ContentBrowserClient::ShouldAllowOpenURL(SiteInstance* site_instance,
60 const GURL& url) {
61 return true;
64 bool ContentBrowserClient::IsSuitableHost(RenderProcessHost* process_host,
65 const GURL& site_url) {
66 return true;
69 bool ContentBrowserClient::MayReuseHost(RenderProcessHost* process_host) {
70 return true;
73 bool ContentBrowserClient::ShouldTryToUseExistingProcessHost(
74 BrowserContext* browser_context, const GURL& url) {
75 return false;
78 bool ContentBrowserClient::ShouldSwapBrowsingInstancesForNavigation(
79 SiteInstance* site_instance,
80 const GURL& current_url,
81 const GURL& new_url) {
82 return false;
85 bool ContentBrowserClient::ShouldSwapProcessesForRedirect(
86 ResourceContext* resource_context, const GURL& current_url,
87 const GURL& new_url) {
88 return false;
91 bool ContentBrowserClient::ShouldAssignSiteForURL(const GURL& url) {
92 return true;
95 std::string ContentBrowserClient::GetCanonicalEncodingNameByAliasName(
96 const std::string& alias_name) {
97 return std::string();
100 std::string ContentBrowserClient::GetApplicationLocale() {
101 return "en-US";
104 std::string ContentBrowserClient::GetAcceptLangs(BrowserContext* context) {
105 return std::string();
108 const gfx::ImageSkia* ContentBrowserClient::GetDefaultFavicon() {
109 static gfx::ImageSkia* empty = new gfx::ImageSkia();
110 return empty;
113 bool ContentBrowserClient::AllowAppCache(const GURL& manifest_url,
114 const GURL& first_party,
115 ResourceContext* context) {
116 return true;
119 bool ContentBrowserClient::AllowServiceWorker(
120 const GURL& scope,
121 const GURL& document_url,
122 content::ResourceContext* context) {
123 return true;
126 bool ContentBrowserClient::AllowGetCookie(const GURL& url,
127 const GURL& first_party,
128 const net::CookieList& cookie_list,
129 ResourceContext* context,
130 int render_process_id,
131 int render_frame_id) {
132 return true;
135 bool ContentBrowserClient::AllowSetCookie(const GURL& url,
136 const GURL& first_party,
137 const std::string& cookie_line,
138 ResourceContext* context,
139 int render_process_id,
140 int render_frame_id,
141 net::CookieOptions* options) {
142 return true;
145 bool ContentBrowserClient::AllowSaveLocalState(ResourceContext* context) {
146 return true;
149 bool ContentBrowserClient::AllowWorkerDatabase(
150 const GURL& url,
151 const base::string16& name,
152 const base::string16& display_name,
153 unsigned long estimated_size,
154 ResourceContext* context,
155 const std::vector<std::pair<int, int> >& render_frames) {
156 return true;
159 void ContentBrowserClient::AllowWorkerFileSystem(
160 const GURL& url,
161 ResourceContext* context,
162 const std::vector<std::pair<int, int> >& render_frames,
163 base::Callback<void(bool)> callback) {
164 callback.Run(true);
167 bool ContentBrowserClient::AllowWorkerIndexedDB(
168 const GURL& url,
169 const base::string16& name,
170 ResourceContext* context,
171 const std::vector<std::pair<int, int> >& render_frames) {
172 return true;
175 QuotaPermissionContext* ContentBrowserClient::CreateQuotaPermissionContext() {
176 return nullptr;
179 void ContentBrowserClient::SelectClientCertificate(
180 int render_process_id,
181 int render_frame_id,
182 net::SSLCertRequestInfo* cert_request_info,
183 const base::Callback<void(net::X509Certificate*)>& callback) {
184 callback.Run(nullptr);
187 net::URLRequestContext* ContentBrowserClient::OverrideRequestContextForURL(
188 const GURL& url, ResourceContext* context) {
189 return nullptr;
192 std::string ContentBrowserClient::GetStoragePartitionIdForSite(
193 BrowserContext* browser_context,
194 const GURL& site) {
195 return std::string();
198 bool ContentBrowserClient::IsValidStoragePartitionId(
199 BrowserContext* browser_context,
200 const std::string& partition_id) {
201 // Since the GetStoragePartitionIdForChildProcess() only generates empty
202 // strings, we should only ever see empty strings coming back.
203 return partition_id.empty();
206 void ContentBrowserClient::GetStoragePartitionConfigForSite(
207 BrowserContext* browser_context,
208 const GURL& site,
209 bool can_be_default,
210 std::string* partition_domain,
211 std::string* partition_name,
212 bool* in_memory) {
213 partition_domain->clear();
214 partition_name->clear();
215 *in_memory = false;
218 MediaObserver* ContentBrowserClient::GetMediaObserver() {
219 return nullptr;
222 PlatformNotificationService*
223 ContentBrowserClient::GetPlatformNotificationService() {
224 return nullptr;
227 void ContentBrowserClient::RequestPermission(
228 PermissionType permission,
229 WebContents* web_contents,
230 int bridge_id,
231 const GURL& requesting_frame,
232 bool user_gesture,
233 const base::Callback<void(PermissionStatus)>& callback) {
234 callback.Run(PERMISSION_STATUS_DENIED);
237 PermissionStatus ContentBrowserClient::GetPermissionStatus(
238 PermissionType permission,
239 BrowserContext* browser_context,
240 const GURL& requesting_origin,
241 const GURL& embedding_origin) {
242 return PERMISSION_STATUS_DENIED;
245 bool ContentBrowserClient::CanCreateWindow(
246 const GURL& opener_url,
247 const GURL& opener_top_level_frame_url,
248 const GURL& source_origin,
249 WindowContainerType container_type,
250 const GURL& target_url,
251 const Referrer& referrer,
252 WindowOpenDisposition disposition,
253 const blink::WebWindowFeatures& features,
254 bool user_gesture,
255 bool opener_suppressed,
256 ResourceContext* context,
257 int render_process_id,
258 int opener_id,
259 bool* no_javascript_access) {
260 *no_javascript_access = false;
261 return true;
264 SpeechRecognitionManagerDelegate*
265 ContentBrowserClient::CreateSpeechRecognitionManagerDelegate() {
266 return nullptr;
269 net::NetLog* ContentBrowserClient::GetNetLog() {
270 return nullptr;
273 AccessTokenStore* ContentBrowserClient::CreateAccessTokenStore() {
274 return nullptr;
277 bool ContentBrowserClient::IsFastShutdownPossible() {
278 return true;
281 base::FilePath ContentBrowserClient::GetDefaultDownloadDirectory() {
282 return base::FilePath();
285 std::string ContentBrowserClient::GetDefaultDownloadName() {
286 return std::string();
289 BrowserPpapiHost*
290 ContentBrowserClient::GetExternalBrowserPpapiHost(int plugin_process_id) {
291 return nullptr;
294 bool ContentBrowserClient::AllowPepperSocketAPI(
295 BrowserContext* browser_context,
296 const GURL& url,
297 bool private_api,
298 const SocketPermissionRequest* params) {
299 return false;
302 ui::SelectFilePolicy* ContentBrowserClient::CreateSelectFilePolicy(
303 WebContents* web_contents) {
304 return nullptr;
307 LocationProvider* ContentBrowserClient::OverrideSystemLocationProvider() {
308 return nullptr;
311 DevToolsManagerDelegate* ContentBrowserClient::GetDevToolsManagerDelegate() {
312 return nullptr;
315 TracingDelegate* ContentBrowserClient::GetTracingDelegate() {
316 return nullptr;
319 bool ContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle(
320 BrowserContext* browser_context,
321 const GURL& url) {
322 return false;
325 bool ContentBrowserClient::IsPluginAllowedToUseDevChannelAPIs(
326 BrowserContext* browser_context,
327 const GURL& url) {
328 return false;
331 net::CookieStore* ContentBrowserClient::OverrideCookieStoreForRenderProcess(
332 int render_process_id) {
333 return nullptr;
336 bool ContentBrowserClient::CheckMediaAccessPermission(
337 BrowserContext* browser_context,
338 const GURL& security_origin,
339 MediaStreamType type) {
340 return false;
343 PresentationServiceDelegate*
344 ContentBrowserClient::GetPresentationServiceDelegate(
345 WebContents* web_contents) {
346 return nullptr;
349 void ContentBrowserClient::OpenURL(
350 content::BrowserContext* browser_context,
351 const content::OpenURLParams& params,
352 const base::Callback<void(content::WebContents*)>& callback) {
353 callback.Run(nullptr);
356 #if defined(OS_WIN)
357 const wchar_t* ContentBrowserClient::GetResourceDllName() {
358 return nullptr;
360 #endif
362 #if defined(VIDEO_HOLE)
363 ExternalVideoSurfaceContainer*
364 ContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer(
365 WebContents* web_contents) {
366 return nullptr;
368 #endif
370 } // namespace content