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