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