OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "android_webview/browser/aw_content_browser_client.h" | 5 #include "android_webview/browser/aw_content_browser_client.h" |
6 | 6 |
7 #include "android_webview/browser/aw_browser_main_parts.h" | 7 #include "android_webview/browser/aw_browser_main_parts.h" |
8 #include "android_webview/browser/aw_cookie_access_policy.h" | 8 #include "android_webview/browser/aw_cookie_access_policy.h" |
9 #include "android_webview/browser/aw_quota_permission_context.h" | 9 #include "android_webview/browser/aw_quota_permission_context.h" |
10 #include "android_webview/browser/net_disk_cache_remover.h" | 10 #include "android_webview/browser/net_disk_cache_remover.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 }; | 41 }; |
42 | 42 |
43 } | 43 } |
44 | 44 |
45 namespace android_webview { | 45 namespace android_webview { |
46 | 46 |
47 AwContentBrowserClient::AwContentBrowserClient( | 47 AwContentBrowserClient::AwContentBrowserClient( |
48 ViewDelegateFactoryFn* view_delegate_factory, | 48 ViewDelegateFactoryFn* view_delegate_factory, |
49 GeolocationPermissionFactoryFn* geolocation_permission_factory) | 49 GeolocationPermissionFactoryFn* geolocation_permission_factory) |
50 : view_delegate_factory_(view_delegate_factory) { | 50 : view_delegate_factory_(view_delegate_factory) { |
51 FilePath user_data_dir; | 51 base::FilePath user_data_dir; |
52 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &user_data_dir)) { | 52 if (!PathService::Get(base::DIR_ANDROID_APP_DATA, &user_data_dir)) { |
53 NOTREACHED() << "Failed to get app data directory for Android WebView"; | 53 NOTREACHED() << "Failed to get app data directory for Android WebView"; |
54 } | 54 } |
55 browser_context_.reset( | 55 browser_context_.reset( |
56 new AwBrowserContext(user_data_dir, geolocation_permission_factory)); | 56 new AwBrowserContext(user_data_dir, geolocation_permission_factory)); |
57 } | 57 } |
58 | 58 |
59 AwContentBrowserClient::~AwContentBrowserClient() { | 59 AwContentBrowserClient::~AwContentBrowserClient() { |
60 } | 60 } |
61 | 61 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 DCHECK(browser_context_.get() == browser_context); | 117 DCHECK(browser_context_.get() == browser_context); |
118 return browser_context_->CreateRequestContext( | 118 return browser_context_->CreateRequestContext( |
119 blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(), | 119 blob_protocol_handler.Pass(), file_system_protocol_handler.Pass(), |
120 developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(), | 120 developer_protocol_handler.Pass(), chrome_protocol_handler.Pass(), |
121 chrome_devtools_protocol_handler.Pass()); | 121 chrome_devtools_protocol_handler.Pass()); |
122 } | 122 } |
123 | 123 |
124 net::URLRequestContextGetter* | 124 net::URLRequestContextGetter* |
125 AwContentBrowserClient::CreateRequestContextForStoragePartition( | 125 AwContentBrowserClient::CreateRequestContextForStoragePartition( |
126 content::BrowserContext* browser_context, | 126 content::BrowserContext* browser_context, |
127 const FilePath& partition_path, | 127 const base::FilePath& partition_path, |
128 bool in_memory, | 128 bool in_memory, |
129 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 129 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
130 blob_protocol_handler, | 130 blob_protocol_handler, |
131 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 131 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
132 file_system_protocol_handler, | 132 file_system_protocol_handler, |
133 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 133 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
134 developer_protocol_handler, | 134 developer_protocol_handler, |
135 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 135 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
136 chrome_protocol_handler, | 136 chrome_protocol_handler, |
137 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> | 137 scoped_ptr<net::URLRequestJobFactory::ProtocolHandler> |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 void AwContentBrowserClient::ClearCache(content::RenderViewHost* rvh) { | 353 void AwContentBrowserClient::ClearCache(content::RenderViewHost* rvh) { |
354 RemoveHttpDiskCache(rvh->GetProcess()->GetBrowserContext(), | 354 RemoveHttpDiskCache(rvh->GetProcess()->GetBrowserContext(), |
355 rvh->GetProcess()->GetID()); | 355 rvh->GetProcess()->GetID()); |
356 } | 356 } |
357 | 357 |
358 void AwContentBrowserClient::ClearCookies(content::RenderViewHost* rvh) { | 358 void AwContentBrowserClient::ClearCookies(content::RenderViewHost* rvh) { |
359 // TODO(boliu): Implement. | 359 // TODO(boliu): Implement. |
360 NOTIMPLEMENTED(); | 360 NOTIMPLEMENTED(); |
361 } | 361 } |
362 | 362 |
363 FilePath AwContentBrowserClient::GetDefaultDownloadDirectory() { | 363 base::FilePath AwContentBrowserClient::GetDefaultDownloadDirectory() { |
364 // Android WebView does not currently use the Chromium downloads system. | 364 // Android WebView does not currently use the Chromium downloads system. |
365 // Download requests are cancelled immedately when recognized; see | 365 // Download requests are cancelled immedately when recognized; see |
366 // AwResourceDispatcherHost::CreateResourceHandlerForDownload. However the | 366 // AwResourceDispatcherHost::CreateResourceHandlerForDownload. However the |
367 // download system still tries to start up and calls this before recognizing | 367 // download system still tries to start up and calls this before recognizing |
368 // the request has been cancelled. | 368 // the request has been cancelled. |
369 return FilePath(); | 369 return base::FilePath(); |
370 } | 370 } |
371 | 371 |
372 std::string AwContentBrowserClient::GetDefaultDownloadName() { | 372 std::string AwContentBrowserClient::GetDefaultDownloadName() { |
373 NOTREACHED() << "Android WebView does not use chromium downloads"; | 373 NOTREACHED() << "Android WebView does not use chromium downloads"; |
374 return std::string(); | 374 return std::string(); |
375 } | 375 } |
376 | 376 |
377 void AwContentBrowserClient::DidCreatePpapiPlugin( | 377 void AwContentBrowserClient::DidCreatePpapiPlugin( |
378 content::BrowserPpapiHost* browser_host) { | 378 content::BrowserPpapiHost* browser_host) { |
379 NOTREACHED() << "Android WebView does not support plugins"; | 379 NOTREACHED() << "Android WebView does not support plugins"; |
380 } | 380 } |
381 | 381 |
382 bool AwContentBrowserClient::AllowPepperSocketAPI( | 382 bool AwContentBrowserClient::AllowPepperSocketAPI( |
383 content::BrowserContext* browser_context, | 383 content::BrowserContext* browser_context, |
384 const GURL& url, | 384 const GURL& url, |
385 const content::SocketPermissionRequest& params) { | 385 const content::SocketPermissionRequest& params) { |
386 NOTREACHED() << "Android WebView does not support plugins"; | 386 NOTREACHED() << "Android WebView does not support plugins"; |
387 return false; | 387 return false; |
388 } | 388 } |
389 | 389 |
390 } // namespace android_webview | 390 } // namespace android_webview |
OLD | NEW |