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_browser_context.h" | 5 #include "android_webview/browser/aw_browser_context.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "android_webview/browser/aw_browser_policy_connector.h" | 9 #include "android_webview/browser/aw_browser_policy_connector.h" |
10 #include "android_webview/browser/aw_form_database_service.h" | 10 #include "android_webview/browser/aw_form_database_service.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 void DeleteDirRecursively(const base::FilePath& path) { | 72 void DeleteDirRecursively(const base::FilePath& path) { |
73 if (!base::DeleteFile(path, true)) { | 73 if (!base::DeleteFile(path, true)) { |
74 // Deleting a non-existent file is considered successful, so this will | 74 // Deleting a non-existent file is considered successful, so this will |
75 // trigger only in case of real errors. | 75 // trigger only in case of real errors. |
76 LOG(WARNING) << "Failed to delete " << path.AsUTF8Unsafe(); | 76 LOG(WARNING) << "Failed to delete " << path.AsUTF8Unsafe(); |
77 } | 77 } |
78 } | 78 } |
79 | 79 |
80 AwBrowserContext* g_browser_context = NULL; | 80 AwBrowserContext* g_browser_context = NULL; |
81 | 81 |
82 scoped_ptr<net::ProxyConfigService> CreateProxyConfigService() { | 82 std::unique_ptr<net::ProxyConfigService> CreateProxyConfigService() { |
83 scoped_ptr<net::ProxyConfigService> config_service = | 83 std::unique_ptr<net::ProxyConfigService> config_service = |
84 net::ProxyService::CreateSystemProxyConfigService( | 84 net::ProxyService::CreateSystemProxyConfigService( |
85 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 85 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
86 nullptr /* Ignored on Android */); | 86 nullptr /* Ignored on Android */); |
87 | 87 |
88 // TODO(csharrison) Architect the wrapper better so we don't need a cast for | 88 // TODO(csharrison) Architect the wrapper better so we don't need a cast for |
89 // android ProxyConfigServices. | 89 // android ProxyConfigServices. |
90 net::ProxyConfigServiceAndroid* android_config_service = | 90 net::ProxyConfigServiceAndroid* android_config_service = |
91 static_cast<net::ProxyConfigServiceAndroid*>(config_service.get()); | 91 static_cast<net::ProxyConfigServiceAndroid*>(config_service.get()); |
92 android_config_service->set_exclude_pac_url(true); | 92 android_config_service->set_exclude_pac_url(true); |
93 return config_service; | 93 return config_service; |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 data_reduction_proxy::Client::WEBVIEW_ANDROID, | 210 data_reduction_proxy::Client::WEBVIEW_ANDROID, |
211 data_reduction_proxy::DataReductionProxyParams::kAllowed, | 211 data_reduction_proxy::DataReductionProxyParams::kAllowed, |
212 url_request_context_getter_->GetNetLog(), | 212 url_request_context_getter_->GetNetLog(), |
213 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), | 213 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO), |
214 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 214 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
215 false /* enable */, | 215 false /* enable */, |
216 false /* enable_quic */, | 216 false /* enable_quic */, |
217 GetUserAgent())); | 217 GetUserAgent())); |
218 data_reduction_proxy_settings_.reset( | 218 data_reduction_proxy_settings_.reset( |
219 new data_reduction_proxy::DataReductionProxySettings()); | 219 new data_reduction_proxy::DataReductionProxySettings()); |
220 scoped_ptr<data_reduction_proxy::DataStore> store( | 220 std::unique_ptr<data_reduction_proxy::DataStore> store( |
221 new data_reduction_proxy::DataStore()); | 221 new data_reduction_proxy::DataStore()); |
222 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); | 222 base::SequencedWorkerPool* pool = BrowserThread::GetBlockingPool(); |
223 scoped_refptr<base::SequencedTaskRunner> db_task_runner = | 223 scoped_refptr<base::SequencedTaskRunner> db_task_runner = |
224 pool->GetSequencedTaskRunnerWithShutdownBehavior( | 224 pool->GetSequencedTaskRunnerWithShutdownBehavior( |
225 pool->GetSequenceToken(), | 225 pool->GetSequenceToken(), |
226 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); | 226 base::SequencedWorkerPool::SKIP_ON_SHUTDOWN); |
227 data_reduction_proxy_service_.reset( | 227 data_reduction_proxy_service_.reset( |
228 new data_reduction_proxy::DataReductionProxyService( | 228 new data_reduction_proxy::DataReductionProxyService( |
229 data_reduction_proxy_settings_.get(), nullptr, | 229 data_reduction_proxy_settings_.get(), nullptr, |
230 GetAwURLRequestContext(), std::move(store), | 230 GetAwURLRequestContext(), std::move(store), |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 make_scoped_refptr(new policy::ConfigurationPolicyPrefStore( | 350 make_scoped_refptr(new policy::ConfigurationPolicyPrefStore( |
351 browser_policy_connector_->GetPolicyService(), | 351 browser_policy_connector_->GetPolicyService(), |
352 browser_policy_connector_->GetHandlerList(), | 352 browser_policy_connector_->GetHandlerList(), |
353 policy::POLICY_LEVEL_MANDATORY))); | 353 policy::POLICY_LEVEL_MANDATORY))); |
354 pref_service_factory.set_read_error_callback(base::Bind(&HandleReadError)); | 354 pref_service_factory.set_read_error_callback(base::Bind(&HandleReadError)); |
355 user_pref_service_ = pref_service_factory.Create(pref_registry); | 355 user_pref_service_ = pref_service_factory.Create(pref_registry); |
356 | 356 |
357 user_prefs::UserPrefs::Set(this, user_pref_service_.get()); | 357 user_prefs::UserPrefs::Set(this, user_pref_service_.get()); |
358 } | 358 } |
359 | 359 |
360 scoped_ptr<content::ZoomLevelDelegate> | 360 std::unique_ptr<content::ZoomLevelDelegate> |
361 AwBrowserContext::CreateZoomLevelDelegate( | 361 AwBrowserContext::CreateZoomLevelDelegate( |
362 const base::FilePath& partition_path) { | 362 const base::FilePath& partition_path) { |
363 return nullptr; | 363 return nullptr; |
364 } | 364 } |
365 | 365 |
366 base::FilePath AwBrowserContext::GetPath() const { | 366 base::FilePath AwBrowserContext::GetPath() const { |
367 return context_storage_path_; | 367 return context_storage_path_; |
368 } | 368 } |
369 | 369 |
370 bool AwBrowserContext::IsOffTheRecord() const { | 370 bool AwBrowserContext::IsOffTheRecord() const { |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 return; | 465 return; |
466 // We don't care about commit_delay for now. It is just a dummy value. | 466 // We don't care about commit_delay for now. It is just a dummy value. |
467 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); | 467 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); |
468 data_reduction_proxy_service->EnableCompressionStatisticsLogging( | 468 data_reduction_proxy_service->EnableCompressionStatisticsLogging( |
469 user_pref_service_.get(), | 469 user_pref_service_.get(), |
470 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 470 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
471 commit_delay); | 471 commit_delay); |
472 } | 472 } |
473 | 473 |
474 } // namespace android_webview | 474 } // namespace android_webview |
OLD | NEW |