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