| 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 <map> | 7 #include <map> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 2761 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2772 extra_parts_[i]->GetURLRequestAutoMountHandlers(handlers); | 2772 extra_parts_[i]->GetURLRequestAutoMountHandlers(handlers); |
| 2773 } | 2773 } |
| 2774 | 2774 |
| 2775 ::rappor::RapporService* ChromeContentBrowserClient::GetRapporService() { | 2775 ::rappor::RapporService* ChromeContentBrowserClient::GetRapporService() { |
| 2776 return g_browser_process->rappor_service(); | 2776 return g_browser_process->rappor_service(); |
| 2777 } | 2777 } |
| 2778 | 2778 |
| 2779 void ChromeContentBrowserClient::GetAdditionalFileSystemBackends( | 2779 void ChromeContentBrowserClient::GetAdditionalFileSystemBackends( |
| 2780 content::BrowserContext* browser_context, | 2780 content::BrowserContext* browser_context, |
| 2781 const base::FilePath& storage_partition_path, | 2781 const base::FilePath& storage_partition_path, |
| 2782 ScopedVector<storage::FileSystemBackend>* additional_backends) { | 2782 std::vector<std::unique_ptr<storage::FileSystemBackend>>* |
| 2783 additional_backends) { |
| 2783 #if defined(OS_CHROMEOS) | 2784 #if defined(OS_CHROMEOS) |
| 2784 storage::ExternalMountPoints* external_mount_points = | 2785 storage::ExternalMountPoints* external_mount_points = |
| 2785 content::BrowserContext::GetMountPoints(browser_context); | 2786 content::BrowserContext::GetMountPoints(browser_context); |
| 2786 DCHECK(external_mount_points); | 2787 DCHECK(external_mount_points); |
| 2787 chromeos::FileSystemBackend* backend = new chromeos::FileSystemBackend( | 2788 auto backend = base::MakeUnique<chromeos::FileSystemBackend>( |
| 2788 base::MakeUnique<drive::FileSystemBackendDelegate>(), | 2789 base::MakeUnique<drive::FileSystemBackendDelegate>(), |
| 2789 base::MakeUnique<chromeos::file_system_provider::BackendDelegate>(), | 2790 base::MakeUnique<chromeos::file_system_provider::BackendDelegate>(), |
| 2790 base::MakeUnique<chromeos::MTPFileSystemBackendDelegate>( | 2791 base::MakeUnique<chromeos::MTPFileSystemBackendDelegate>( |
| 2791 storage_partition_path), | 2792 storage_partition_path), |
| 2792 base::MakeUnique<arc::ArcContentFileSystemBackendDelegate>(), | 2793 base::MakeUnique<arc::ArcContentFileSystemBackendDelegate>(), |
| 2793 base::MakeUnique<arc::ArcDocumentsProviderBackendDelegate>(), | 2794 base::MakeUnique<arc::ArcDocumentsProviderBackendDelegate>(), |
| 2794 external_mount_points, storage::ExternalMountPoints::GetSystemInstance()); | 2795 external_mount_points, storage::ExternalMountPoints::GetSystemInstance()); |
| 2795 backend->AddSystemMountPoints(); | 2796 backend->AddSystemMountPoints(); |
| 2796 DCHECK(backend->CanHandleType(storage::kFileSystemTypeExternal)); | 2797 DCHECK(backend->CanHandleType(storage::kFileSystemTypeExternal)); |
| 2797 additional_backends->push_back(backend); | 2798 additional_backends->push_back(std::move(backend)); |
| 2798 #endif | 2799 #endif |
| 2799 | 2800 |
| 2800 for (size_t i = 0; i < extra_parts_.size(); ++i) { | 2801 for (size_t i = 0; i < extra_parts_.size(); ++i) { |
| 2801 extra_parts_[i]->GetAdditionalFileSystemBackends( | 2802 extra_parts_[i]->GetAdditionalFileSystemBackends( |
| 2802 browser_context, storage_partition_path, additional_backends); | 2803 browser_context, storage_partition_path, additional_backends); |
| 2803 } | 2804 } |
| 2804 } | 2805 } |
| 2805 | 2806 |
| 2806 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 2807 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 2807 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( | 2808 void ChromeContentBrowserClient::GetAdditionalMappedFilesForChildProcess( |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3156 } | 3157 } |
| 3157 | 3158 |
| 3158 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, | 3159 void ChromeContentBrowserClient::RecordURLMetric(const std::string& metric, |
| 3159 const GURL& url) { | 3160 const GURL& url) { |
| 3160 if (url.is_valid()) { | 3161 if (url.is_valid()) { |
| 3161 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), | 3162 rappor::SampleDomainAndRegistryFromGURL(g_browser_process->rappor_service(), |
| 3162 metric, url); | 3163 metric, url); |
| 3163 } | 3164 } |
| 3164 } | 3165 } |
| 3165 | 3166 |
| 3166 ScopedVector<content::NavigationThrottle> | 3167 std::vector<std::unique_ptr<content::NavigationThrottle>> |
| 3167 ChromeContentBrowserClient::CreateThrottlesForNavigation( | 3168 ChromeContentBrowserClient::CreateThrottlesForNavigation( |
| 3168 content::NavigationHandle* handle) { | 3169 content::NavigationHandle* handle) { |
| 3169 ScopedVector<content::NavigationThrottle> throttles; | 3170 std::vector<std::unique_ptr<content::NavigationThrottle>> throttles; |
| 3170 | 3171 |
| 3171 #if BUILDFLAG(ENABLE_PLUGINS) | 3172 #if BUILDFLAG(ENABLE_PLUGINS) |
| 3172 std::unique_ptr<content::NavigationThrottle> flash_url_throttle = | 3173 std::unique_ptr<content::NavigationThrottle> flash_url_throttle = |
| 3173 FlashDownloadInterception::MaybeCreateThrottleFor(handle); | 3174 FlashDownloadInterception::MaybeCreateThrottleFor(handle); |
| 3174 if (flash_url_throttle) | 3175 if (flash_url_throttle) |
| 3175 throttles.push_back(std::move(flash_url_throttle)); | 3176 throttles.push_back(std::move(flash_url_throttle)); |
| 3176 #endif | 3177 #endif |
| 3177 | 3178 |
| 3178 if (handle->IsInMainFrame()) { | 3179 if (handle->IsInMainFrame()) { |
| 3179 throttles.push_back( | 3180 throttles.push_back( |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3225 auto intent_picker_cb = base::Bind(ShowIntentPickerBubble()); | 3226 auto intent_picker_cb = base::Bind(ShowIntentPickerBubble()); |
| 3226 auto url_to_arc_throttle = base::MakeUnique<arc::ArcNavigationThrottle>( | 3227 auto url_to_arc_throttle = base::MakeUnique<arc::ArcNavigationThrottle>( |
| 3227 handle, intent_picker_cb); | 3228 handle, intent_picker_cb); |
| 3228 throttles.push_back(std::move(url_to_arc_throttle)); | 3229 throttles.push_back(std::move(url_to_arc_throttle)); |
| 3229 } | 3230 } |
| 3230 } | 3231 } |
| 3231 } | 3232 } |
| 3232 #endif | 3233 #endif |
| 3233 | 3234 |
| 3234 #if BUILDFLAG(ENABLE_EXTENSIONS) | 3235 #if BUILDFLAG(ENABLE_EXTENSIONS) |
| 3235 throttles.push_back(new extensions::ExtensionNavigationThrottle(handle)); | 3236 throttles.push_back( |
| 3237 base::MakeUnique<extensions::ExtensionNavigationThrottle>(handle)); |
| 3236 #endif | 3238 #endif |
| 3237 | 3239 |
| 3238 return throttles; | 3240 return throttles; |
| 3239 } | 3241 } |
| 3240 | 3242 |
| 3241 std::unique_ptr<content::NavigationUIData> | 3243 std::unique_ptr<content::NavigationUIData> |
| 3242 ChromeContentBrowserClient::GetNavigationUIData( | 3244 ChromeContentBrowserClient::GetNavigationUIData( |
| 3243 content::NavigationHandle* navigation_handle) { | 3245 content::NavigationHandle* navigation_handle) { |
| 3244 return base::MakeUnique<ChromeNavigationUIData>(navigation_handle); | 3246 return base::MakeUnique<ChromeNavigationUIData>(navigation_handle); |
| 3245 } | 3247 } |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3368 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { | 3370 bool ChromeContentBrowserClient::ShouldRedirectDOMStorageTaskRunner() { |
| 3369 return variations::GetVariationParamValue( | 3371 return variations::GetVariationParamValue( |
| 3370 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; | 3372 "BrowserScheduler", "RedirectDOMStorageTaskRunner") == "true"; |
| 3371 } | 3373 } |
| 3372 | 3374 |
| 3373 bool ChromeContentBrowserClient:: | 3375 bool ChromeContentBrowserClient:: |
| 3374 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { | 3376 RedirectNonUINonIOBrowserThreadsToTaskScheduler() { |
| 3375 return variations::GetVariationParamValue( | 3377 return variations::GetVariationParamValue( |
| 3376 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; | 3378 "BrowserScheduler", "RedirectNonUINonIOBrowserThreads") == "true"; |
| 3377 } | 3379 } |
| OLD | NEW |