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