content_browser_client.cc revision cedac228d2dd51db4b79ea1e72c7f249408ee061
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. 4 5#include "content/public/browser/content_browser_client.h" 6 7#include "base/files/file_path.h" 8#include "ui/gfx/image/image_skia.h" 9#include "url/gurl.h" 10 11namespace content { 12 13BrowserMainParts* ContentBrowserClient::CreateBrowserMainParts( 14 const MainFunctionParams& parameters) { 15 return NULL; 16} 17 18WebContentsViewDelegate* ContentBrowserClient::GetWebContentsViewDelegate( 19 WebContents* web_contents) { 20 return NULL; 21} 22 23GURL ContentBrowserClient::GetEffectiveURL(BrowserContext* browser_context, 24 const GURL& url) { 25 return url; 26} 27 28bool ContentBrowserClient::ShouldUseProcessPerSite( 29 BrowserContext* browser_context, const GURL& effective_url) { 30 return false; 31} 32 33net::URLRequestContextGetter* ContentBrowserClient::CreateRequestContext( 34 BrowserContext* browser_context, 35 ProtocolHandlerMap* protocol_handlers, 36 URLRequestInterceptorScopedVector request_interceptors) { 37 return NULL; 38} 39 40net::URLRequestContextGetter* 41ContentBrowserClient::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 NULL; 48} 49 50bool ContentBrowserClient::IsHandledURL(const GURL& url) { 51 return false; 52} 53 54bool ContentBrowserClient::CanCommitURL(RenderProcessHost* process_host, 55 const GURL& site_url) { 56 return true; 57} 58 59bool ContentBrowserClient::ShouldAllowOpenURL(SiteInstance* site_instance, 60 const GURL& url) { 61 return true; 62} 63 64bool ContentBrowserClient::IsSuitableHost(RenderProcessHost* process_host, 65 const GURL& site_url) { 66 return true; 67} 68 69bool ContentBrowserClient::MayReuseHost(RenderProcessHost* process_host) { 70 return true; 71} 72 73bool ContentBrowserClient::ShouldTryToUseExistingProcessHost( 74 BrowserContext* browser_context, const GURL& url) { 75 return false; 76} 77 78bool ContentBrowserClient::ShouldSwapBrowsingInstancesForNavigation( 79 SiteInstance* site_instance, 80 const GURL& current_url, 81 const GURL& new_url) { 82 return false; 83} 84 85bool ContentBrowserClient::ShouldSwapProcessesForRedirect( 86 ResourceContext* resource_context, const GURL& current_url, 87 const GURL& new_url) { 88 return false; 89} 90 91bool ContentBrowserClient::ShouldAssignSiteForURL(const GURL& url) { 92 return true; 93} 94 95std::string ContentBrowserClient::GetCanonicalEncodingNameByAliasName( 96 const std::string& alias_name) { 97 return std::string(); 98} 99 100std::string ContentBrowserClient::GetApplicationLocale() { 101 return "en-US"; 102} 103 104std::string ContentBrowserClient::GetAcceptLangs(BrowserContext* context) { 105 return std::string(); 106} 107 108gfx::ImageSkia* ContentBrowserClient::GetDefaultFavicon() { 109 static gfx::ImageSkia* empty = new gfx::ImageSkia(); 110 return empty; 111} 112 113bool ContentBrowserClient::AllowAppCache(const GURL& manifest_url, 114 const GURL& first_party, 115 ResourceContext* context) { 116 return true; 117} 118 119bool ContentBrowserClient::AllowGetCookie(const GURL& url, 120 const GURL& first_party, 121 const net::CookieList& cookie_list, 122 ResourceContext* context, 123 int render_process_id, 124 int render_frame_id) { 125 return true; 126} 127 128bool ContentBrowserClient::AllowSetCookie(const GURL& url, 129 const GURL& first_party, 130 const std::string& cookie_line, 131 ResourceContext* context, 132 int render_process_id, 133 int render_frame_id, 134 net::CookieOptions* options) { 135 return true; 136} 137 138bool ContentBrowserClient::AllowSaveLocalState(ResourceContext* context) { 139 return true; 140} 141 142bool ContentBrowserClient::AllowWorkerDatabase( 143 const GURL& url, 144 const base::string16& name, 145 const base::string16& display_name, 146 unsigned long estimated_size, 147 ResourceContext* context, 148 const std::vector<std::pair<int, int> >& render_frames) { 149 return true; 150} 151 152bool ContentBrowserClient::AllowWorkerFileSystem( 153 const GURL& url, 154 ResourceContext* context, 155 const std::vector<std::pair<int, int> >& render_frames) { 156 return true; 157} 158 159bool ContentBrowserClient::AllowWorkerIndexedDB( 160 const GURL& url, 161 const base::string16& name, 162 ResourceContext* context, 163 const std::vector<std::pair<int, int> >& render_frames) { 164 return true; 165} 166 167QuotaPermissionContext* ContentBrowserClient::CreateQuotaPermissionContext() { 168 return NULL; 169} 170 171net::URLRequestContext* ContentBrowserClient::OverrideRequestContextForURL( 172 const GURL& url, ResourceContext* context) { 173 return NULL; 174} 175 176std::string ContentBrowserClient::GetStoragePartitionIdForSite( 177 BrowserContext* browser_context, 178 const GURL& site) { 179 return std::string(); 180} 181 182bool ContentBrowserClient::IsValidStoragePartitionId( 183 BrowserContext* browser_context, 184 const std::string& partition_id) { 185 // Since the GetStoragePartitionIdForChildProcess() only generates empty 186 // strings, we should only ever see empty strings coming back. 187 return partition_id.empty(); 188} 189 190void ContentBrowserClient::GetStoragePartitionConfigForSite( 191 BrowserContext* browser_context, 192 const GURL& site, 193 bool can_be_default, 194 std::string* partition_domain, 195 std::string* partition_name, 196 bool* in_memory) { 197 partition_domain->clear(); 198 partition_name->clear(); 199 *in_memory = false; 200} 201 202MediaObserver* ContentBrowserClient::GetMediaObserver() { 203 return NULL; 204} 205 206blink::WebNotificationPresenter::Permission 207 ContentBrowserClient::CheckDesktopNotificationPermission( 208 const GURL& source_origin, 209 ResourceContext* context, 210 int render_process_id) { 211 return blink::WebNotificationPresenter::PermissionAllowed; 212} 213 214bool ContentBrowserClient::CanCreateWindow( 215 const GURL& opener_url, 216 const GURL& opener_top_level_frame_url, 217 const GURL& source_origin, 218 WindowContainerType container_type, 219 const GURL& target_url, 220 const Referrer& referrer, 221 WindowOpenDisposition disposition, 222 const blink::WebWindowFeatures& features, 223 bool user_gesture, 224 bool opener_suppressed, 225 ResourceContext* context, 226 int render_process_id, 227 int opener_id, 228 bool* no_javascript_access) { 229 *no_javascript_access = false; 230 return true; 231} 232 233std::string ContentBrowserClient::GetWorkerProcessTitle( 234 const GURL& url, ResourceContext* context) { 235 return std::string(); 236} 237 238SpeechRecognitionManagerDelegate* 239 ContentBrowserClient::GetSpeechRecognitionManagerDelegate() { 240 return NULL; 241} 242 243net::NetLog* ContentBrowserClient::GetNetLog() { 244 return NULL; 245} 246 247AccessTokenStore* ContentBrowserClient::CreateAccessTokenStore() { 248 return NULL; 249} 250 251bool ContentBrowserClient::IsFastShutdownPossible() { 252 return true; 253} 254 255base::FilePath ContentBrowserClient::GetDefaultDownloadDirectory() { 256 return base::FilePath(); 257} 258 259std::string ContentBrowserClient::GetDefaultDownloadName() { 260 return std::string(); 261} 262 263BrowserPpapiHost* 264 ContentBrowserClient::GetExternalBrowserPpapiHost(int plugin_process_id) { 265 return NULL; 266} 267 268bool ContentBrowserClient::AllowPepperSocketAPI( 269 BrowserContext* browser_context, 270 const GURL& url, 271 bool private_api, 272 const SocketPermissionRequest* params) { 273 return false; 274} 275 276ui::SelectFilePolicy* ContentBrowserClient::CreateSelectFilePolicy( 277 WebContents* web_contents) { 278 return NULL; 279} 280 281LocationProvider* ContentBrowserClient::OverrideSystemLocationProvider() { 282 return NULL; 283} 284 285VibrationProvider* ContentBrowserClient::OverrideVibrationProvider() { 286 return NULL; 287} 288 289DevToolsManagerDelegate* ContentBrowserClient::GetDevToolsManagerDelegate() { 290 return NULL; 291} 292 293#if defined(OS_WIN) 294const wchar_t* ContentBrowserClient::GetResourceDllName() { 295 return NULL; 296} 297#endif 298 299bool ContentBrowserClient::IsPluginAllowedToCallRequestOSFileHandle( 300 BrowserContext* browser_context, 301 const GURL& url) { 302 return false; 303} 304 305bool ContentBrowserClient::IsPluginAllowedToUseDevChannelAPIs() { 306 return false; 307} 308 309net::CookieStore* ContentBrowserClient::OverrideCookieStoreForRenderProcess( 310 int render_process_id) { 311 return NULL; 312} 313 314#if defined(VIDEO_HOLE) 315ExternalVideoSurfaceContainer* 316ContentBrowserClient::OverrideCreateExternalVideoSurfaceContainer( 317 WebContents* web_contents) { 318 return NULL; 319} 320#endif 321 322} // namespace content 323