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 "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 #include "net/base/escape.h" | 131 #include "net/base/escape.h" |
132 #include "net/base/mime_util.h" | 132 #include "net/base/mime_util.h" |
133 #include "net/cookies/canonical_cookie.h" | 133 #include "net/cookies/canonical_cookie.h" |
134 #include "net/cookies/cookie_options.h" | 134 #include "net/cookies/cookie_options.h" |
135 #include "net/ssl/ssl_cert_request_info.h" | 135 #include "net/ssl/ssl_cert_request_info.h" |
136 #include "ppapi/host/ppapi_host.h" | 136 #include "ppapi/host/ppapi_host.h" |
137 #include "ui/base/l10n/l10n_util.h" | 137 #include "ui/base/l10n/l10n_util.h" |
138 #include "ui/base/resource/resource_bundle.h" | 138 #include "ui/base/resource/resource_bundle.h" |
139 #include "ui/message_center/message_center_util.h" | 139 #include "ui/message_center/message_center_util.h" |
140 #include "webkit/browser/fileapi/external_mount_points.h" | 140 #include "webkit/browser/fileapi/external_mount_points.h" |
| 141 #include "webkit/browser/fileapi/file_system_options.h" |
| 142 #include "webkit/browser/fileapi/syncable/sync_file_system_backend.h" |
141 #include "webkit/common/webpreferences.h" | 143 #include "webkit/common/webpreferences.h" |
142 #include "webkit/plugins/plugin_switches.h" | 144 #include "webkit/plugins/plugin_switches.h" |
143 | 145 |
144 #if defined(OS_WIN) | 146 #if defined(OS_WIN) |
145 #include "chrome/browser/chrome_browser_main_win.h" | 147 #include "chrome/browser/chrome_browser_main_win.h" |
146 #include "sandbox/win/src/sandbox_policy.h" | 148 #include "sandbox/win/src/sandbox_policy.h" |
147 #elif defined(OS_MACOSX) | 149 #elif defined(OS_MACOSX) |
148 #include "chrome/browser/chrome_browser_main_mac.h" | 150 #include "chrome/browser/chrome_browser_main_mac.h" |
149 #include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h" | 151 #include "chrome/browser/spellchecker/spellcheck_message_filter_mac.h" |
150 #elif defined(OS_CHROMEOS) | 152 #elif defined(OS_CHROMEOS) |
(...skipping 2180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2331 std::vector<std::string>* additional_allowed_schemes) { | 2333 std::vector<std::string>* additional_allowed_schemes) { |
2332 ContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( | 2334 ContentBrowserClient::GetAdditionalAllowedSchemesForFileSystem( |
2333 additional_allowed_schemes); | 2335 additional_allowed_schemes); |
2334 additional_allowed_schemes->push_back(kChromeUIScheme); | 2336 additional_allowed_schemes->push_back(kChromeUIScheme); |
2335 additional_allowed_schemes->push_back(extensions::kExtensionScheme); | 2337 additional_allowed_schemes->push_back(extensions::kExtensionScheme); |
2336 } | 2338 } |
2337 | 2339 |
2338 void ChromeContentBrowserClient::GetAdditionalFileSystemBackends( | 2340 void ChromeContentBrowserClient::GetAdditionalFileSystemBackends( |
2339 content::BrowserContext* browser_context, | 2341 content::BrowserContext* browser_context, |
2340 const base::FilePath& storage_partition_path, | 2342 const base::FilePath& storage_partition_path, |
| 2343 const fileapi::FileSystemOptions& options, |
2341 ScopedVector<fileapi::FileSystemBackend>* additional_backends) { | 2344 ScopedVector<fileapi::FileSystemBackend>* additional_backends) { |
2342 #if !defined(OS_ANDROID) | 2345 #if !defined(OS_ANDROID) |
2343 base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool(); | 2346 base::SequencedWorkerPool* pool = content::BrowserThread::GetBlockingPool(); |
2344 additional_backends->push_back(new MediaFileSystemBackend( | 2347 additional_backends->push_back(new MediaFileSystemBackend( |
2345 storage_partition_path, | 2348 storage_partition_path, |
2346 pool->GetSequencedTaskRunner(pool->GetNamedSequenceToken( | 2349 pool->GetSequencedTaskRunner(pool->GetNamedSequenceToken( |
2347 MediaFileSystemBackend::kMediaTaskRunnerName)).get())); | 2350 MediaFileSystemBackend::kMediaTaskRunnerName)).get())); |
2348 #endif | 2351 #endif |
2349 #if defined(OS_CHROMEOS) | 2352 #if defined(OS_CHROMEOS) |
2350 fileapi::ExternalMountPoints* external_mount_points = | 2353 fileapi::ExternalMountPoints* external_mount_points = |
2351 content::BrowserContext::GetMountPoints(browser_context); | 2354 content::BrowserContext::GetMountPoints(browser_context); |
2352 DCHECK(external_mount_points); | 2355 DCHECK(external_mount_points); |
2353 chromeos::FileSystemBackend* backend = | 2356 chromeos::FileSystemBackend* backend = |
2354 new chromeos::FileSystemBackend( | 2357 new chromeos::FileSystemBackend( |
2355 new drive::FileSystemBackendDelegate(browser_context), | 2358 new drive::FileSystemBackendDelegate(browser_context), |
2356 browser_context->GetSpecialStoragePolicy(), | 2359 browser_context->GetSpecialStoragePolicy(), |
2357 external_mount_points, | 2360 external_mount_points, |
2358 fileapi::ExternalMountPoints::GetSystemInstance()); | 2361 fileapi::ExternalMountPoints::GetSystemInstance()); |
2359 backend->AddSystemMountPoints(); | 2362 backend->AddSystemMountPoints(); |
2360 DCHECK(backend->CanHandleType(fileapi::kFileSystemTypeExternal)); | 2363 DCHECK(backend->CanHandleType(fileapi::kFileSystemTypeExternal)); |
2361 additional_backends->push_back(backend); | 2364 additional_backends->push_back(backend); |
2362 #endif | 2365 #endif |
| 2366 |
| 2367 additional_backends->push_back( |
| 2368 new sync_file_system::SyncFileSystemBackend(options)); |
2363 } | 2369 } |
2364 | 2370 |
2365 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 2371 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
2366 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 2372 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
2367 const CommandLine& command_line, | 2373 const CommandLine& command_line, |
2368 int child_process_id, | 2374 int child_process_id, |
2369 std::vector<FileDescriptorInfo>* mappings) { | 2375 std::vector<FileDescriptorInfo>* mappings) { |
2370 #if defined(OS_ANDROID) | 2376 #if defined(OS_ANDROID) |
2371 base::FilePath data_path; | 2377 base::FilePath data_path; |
2372 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path); | 2378 PathService::Get(ui::DIR_RESOURCE_PAKS_ANDROID, &data_path); |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2460 #if defined(USE_NSS) | 2466 #if defined(USE_NSS) |
2461 crypto::CryptoModuleBlockingPasswordDelegate* | 2467 crypto::CryptoModuleBlockingPasswordDelegate* |
2462 ChromeContentBrowserClient::GetCryptoPasswordDelegate( | 2468 ChromeContentBrowserClient::GetCryptoPasswordDelegate( |
2463 const GURL& url) { | 2469 const GURL& url) { |
2464 return chrome::NewCryptoModuleBlockingDialogDelegate( | 2470 return chrome::NewCryptoModuleBlockingDialogDelegate( |
2465 chrome::kCryptoModulePasswordKeygen, url.host()); | 2471 chrome::kCryptoModulePasswordKeygen, url.host()); |
2466 } | 2472 } |
2467 #endif | 2473 #endif |
2468 | 2474 |
2469 } // namespace chrome | 2475 } // namespace chrome |
OLD | NEW |