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