| 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 2897 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2908 ui_task_runner); | 2908 ui_task_runner); |
| 2909 if (NetBenchmarking::CheckBenchmarkingEnabled()) { | 2909 if (NetBenchmarking::CheckBenchmarkingEnabled()) { |
| 2910 Profile* profile = | 2910 Profile* profile = |
| 2911 Profile::FromBrowserContext(render_process_host->GetBrowserContext()); | 2911 Profile::FromBrowserContext(render_process_host->GetBrowserContext()); |
| 2912 net::URLRequestContextGetter* context = | 2912 net::URLRequestContextGetter* context = |
| 2913 render_process_host->GetStoragePartition()->GetURLRequestContext(); | 2913 render_process_host->GetStoragePartition()->GetURLRequestContext(); |
| 2914 registry->AddInterface(base::Bind(&NetBenchmarking::Create, profile, | 2914 registry->AddInterface(base::Bind(&NetBenchmarking::Create, profile, |
| 2915 base::RetainedRef(context))); | 2915 base::RetainedRef(context))); |
| 2916 } | 2916 } |
| 2917 | 2917 |
| 2918 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 2918 if (base::FeatureList::IsEnabled(features::kNetworkService)) { |
| 2919 switches::kEnableNetworkService)) { | |
| 2920 registry->AddInterface( | 2919 registry->AddInterface( |
| 2921 base::Bind(&safe_browsing::MojoSafeBrowsingImpl::Create, | 2920 base::Bind(&safe_browsing::MojoSafeBrowsingImpl::Create, |
| 2922 safe_browsing_service_->database_manager(), | 2921 safe_browsing_service_->database_manager(), |
| 2923 safe_browsing_service_->ui_manager(), | 2922 safe_browsing_service_->ui_manager(), |
| 2924 render_process_host->GetID()), | 2923 render_process_host->GetID()), |
| 2925 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); | 2924 BrowserThread::GetTaskRunnerForThread(BrowserThread::IO)); |
| 2926 } | 2925 } |
| 2927 | 2926 |
| 2928 #if defined(OS_WIN) | 2927 #if defined(OS_WIN) |
| 2929 if (base::FeatureList::IsEnabled(features::kModuleDatabase)) { | 2928 if (base::FeatureList::IsEnabled(features::kModuleDatabase)) { |
| (...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3403 } | 3402 } |
| 3404 | 3403 |
| 3405 base::FilePath ChromeContentBrowserClient::GetLoggingFileName() { | 3404 base::FilePath ChromeContentBrowserClient::GetLoggingFileName() { |
| 3406 return logging::GetLogFileName(); | 3405 return logging::GetLogFileName(); |
| 3407 } | 3406 } |
| 3408 | 3407 |
| 3409 std::vector<std::unique_ptr<content::URLLoaderThrottle>> | 3408 std::vector<std::unique_ptr<content::URLLoaderThrottle>> |
| 3410 ChromeContentBrowserClient::CreateURLLoaderThrottles( | 3409 ChromeContentBrowserClient::CreateURLLoaderThrottles( |
| 3411 const base::Callback<content::WebContents*()>& wc_getter) { | 3410 const base::Callback<content::WebContents*()>& wc_getter) { |
| 3412 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 3411 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 3413 DCHECK(base::CommandLine::ForCurrentProcess()->HasSwitch( | 3412 DCHECK(base::FeatureList::IsEnabled(features::kNetworkService)); |
| 3414 switches::kEnableNetworkService)); | |
| 3415 | 3413 |
| 3416 std::vector<std::unique_ptr<content::URLLoaderThrottle>> result; | 3414 std::vector<std::unique_ptr<content::URLLoaderThrottle>> result; |
| 3417 result.push_back(base::MakeUnique<safe_browsing::BrowserURLLoaderThrottle>( | 3415 result.push_back(base::MakeUnique<safe_browsing::BrowserURLLoaderThrottle>( |
| 3418 safe_browsing_service_->database_manager(), | 3416 safe_browsing_service_->database_manager(), |
| 3419 safe_browsing_service_->ui_manager(), wc_getter)); | 3417 safe_browsing_service_->ui_manager(), wc_getter)); |
| 3420 return result; | 3418 return result; |
| 3421 } | 3419 } |
| 3422 | 3420 |
| 3423 // Static; handles rewriting Web UI URLs. | 3421 // Static; handles rewriting Web UI URLs. |
| 3424 bool ChromeContentBrowserClient::HandleWebUI( | 3422 bool ChromeContentBrowserClient::HandleWebUI( |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3465 // displayed URL when rewriting chrome://help to chrome://settings/help. | 3463 // displayed URL when rewriting chrome://help to chrome://settings/help. |
| 3466 return url->SchemeIs(content::kChromeUIScheme) && | 3464 return url->SchemeIs(content::kChromeUIScheme) && |
| 3467 url->host() == chrome::kChromeUISettingsHost; | 3465 url->host() == chrome::kChromeUISettingsHost; |
| 3468 } | 3466 } |
| 3469 | 3467 |
| 3470 // static | 3468 // static |
| 3471 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( | 3469 void ChromeContentBrowserClient::SetDefaultQuotaSettingsForTesting( |
| 3472 const storage::QuotaSettings* settings) { | 3470 const storage::QuotaSettings* settings) { |
| 3473 g_default_quota_settings = settings; | 3471 g_default_quota_settings = settings; |
| 3474 } | 3472 } |
| OLD | NEW |