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" |
11 #include "android_webview/browser/aw_metrics_service_client.h" | 11 #include "android_webview/browser/aw_metrics_service_client.h" |
12 #include "android_webview/browser/aw_permission_manager.h" | 12 #include "android_webview/browser/aw_permission_manager.h" |
13 #include "android_webview/browser/aw_quota_manager_bridge.h" | 13 #include "android_webview/browser/aw_quota_manager_bridge.h" |
14 #include "android_webview/browser/aw_resource_context.h" | 14 #include "android_webview/browser/aw_resource_context.h" |
15 #include "android_webview/browser/jni_dependency_factory.h" | 15 #include "android_webview/browser/jni_dependency_factory.h" |
16 #include "android_webview/browser/net/aw_url_request_context_getter.h" | 16 #include "android_webview/browser/net/aw_url_request_context_getter.h" |
17 #include "android_webview/common/aw_content_client.h" | 17 #include "android_webview/common/aw_content_client.h" |
18 #include "base/base_paths_android.h" | 18 #include "base/base_paths_android.h" |
19 #include "base/bind.h" | 19 #include "base/bind.h" |
20 #include "base/path_service.h" | 20 #include "base/path_service.h" |
21 #include "components/autofill/core/common/autofill_pref_names.h" | 21 #include "components/autofill/core/common/autofill_pref_names.h" |
22 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp
ression_stats.h" | 22 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_comp
ression_stats.h" |
23 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" | 23 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_io_d
ata.h" |
24 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref
s.h" | 24 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_pref
s.h" |
25 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv
ice.h" | 25 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_serv
ice.h" |
26 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" | 26 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_sett
ings.h" |
27 #include "components/data_reduction_proxy/core/browser/data_store.h" | 27 #include "components/data_reduction_proxy/core/browser/data_store.h" |
28 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param
s.h" | 28 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_param
s.h" |
| 29 #include "components/media_device_id_salt/media_device_id_salt.h" |
29 #include "components/metrics/metrics_service.h" | 30 #include "components/metrics/metrics_service.h" |
30 #include "components/policy/core/browser/browser_policy_connector_base.h" | 31 #include "components/policy/core/browser/browser_policy_connector_base.h" |
31 #include "components/policy/core/browser/configuration_policy_pref_store.h" | 32 #include "components/policy/core/browser/configuration_policy_pref_store.h" |
32 #include "components/policy/core/browser/url_blacklist_manager.h" | 33 #include "components/policy/core/browser/url_blacklist_manager.h" |
33 #include "components/pref_registry/pref_registry_syncable.h" | 34 #include "components/pref_registry/pref_registry_syncable.h" |
34 #include "components/prefs/in_memory_pref_store.h" | 35 #include "components/prefs/in_memory_pref_store.h" |
35 #include "components/prefs/pref_service.h" | 36 #include "components/prefs/pref_service.h" |
36 #include "components/prefs/pref_service_factory.h" | 37 #include "components/prefs/pref_service_factory.h" |
37 #include "components/url_formatter/url_fixer.h" | 38 #include "components/url_formatter/url_fixer.h" |
38 #include "components/user_prefs/user_prefs.h" | 39 #include "components/user_prefs/user_prefs.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 // hardcoded as disabled here. | 313 // hardcoded as disabled here. |
313 pref_registry->RegisterBooleanPref(autofill::prefs::kAutofillEnabled, false); | 314 pref_registry->RegisterBooleanPref(autofill::prefs::kAutofillEnabled, false); |
314 pref_registry->RegisterBooleanPref(kDataReductionProxyEnabled, false); | 315 pref_registry->RegisterBooleanPref(kDataReductionProxyEnabled, false); |
315 data_reduction_proxy::RegisterSimpleProfilePrefs(pref_registry); | 316 data_reduction_proxy::RegisterSimpleProfilePrefs(pref_registry); |
316 policy::URLBlacklistManager::RegisterProfilePrefs(pref_registry); | 317 policy::URLBlacklistManager::RegisterProfilePrefs(pref_registry); |
317 | 318 |
318 pref_registry->RegisterStringPref(prefs::kAuthServerWhitelist, std::string()); | 319 pref_registry->RegisterStringPref(prefs::kAuthServerWhitelist, std::string()); |
319 pref_registry->RegisterStringPref(prefs::kAuthAndroidNegotiateAccountType, | 320 pref_registry->RegisterStringPref(prefs::kAuthAndroidNegotiateAccountType, |
320 std::string()); | 321 std::string()); |
321 | 322 |
| 323 media_device_id_salt::MediaDeviceIDSalt::RegisterProfilePrefs(pref_registry); |
322 metrics::MetricsService::RegisterPrefs(pref_registry); | 324 metrics::MetricsService::RegisterPrefs(pref_registry); |
323 | 325 |
324 PrefServiceFactory pref_service_factory; | 326 PrefServiceFactory pref_service_factory; |
325 pref_service_factory.set_user_prefs(make_scoped_refptr( | 327 pref_service_factory.set_user_prefs(make_scoped_refptr( |
326 new InMemoryPrefStore())); | 328 new InMemoryPrefStore())); |
327 pref_service_factory.set_managed_prefs( | 329 pref_service_factory.set_managed_prefs( |
328 make_scoped_refptr(new policy::ConfigurationPolicyPrefStore( | 330 make_scoped_refptr(new policy::ConfigurationPolicyPrefStore( |
329 browser_policy_connector_->GetPolicyService(), | 331 browser_policy_connector_->GetPolicyService(), |
330 browser_policy_connector_->GetHandlerList(), | 332 browser_policy_connector_->GetHandlerList(), |
331 policy::POLICY_LEVEL_MANDATORY))); | 333 policy::POLICY_LEVEL_MANDATORY))); |
(...skipping 14 matching lines...) Expand all Loading... |
346 } | 348 } |
347 | 349 |
348 bool AwBrowserContext::IsOffTheRecord() const { | 350 bool AwBrowserContext::IsOffTheRecord() const { |
349 // Android WebView does not support off the record profile yet. | 351 // Android WebView does not support off the record profile yet. |
350 return false; | 352 return false; |
351 } | 353 } |
352 | 354 |
353 content::ResourceContext* AwBrowserContext::GetResourceContext() { | 355 content::ResourceContext* AwBrowserContext::GetResourceContext() { |
354 if (!resource_context_) { | 356 if (!resource_context_) { |
355 resource_context_.reset( | 357 resource_context_.reset( |
356 new AwResourceContext(url_request_context_getter_.get())); | 358 new AwResourceContext(url_request_context_getter_.get(), |
| 359 user_pref_service_.get(), IsOffTheRecord())); |
357 } | 360 } |
358 return resource_context_.get(); | 361 return resource_context_.get(); |
359 } | 362 } |
360 | 363 |
361 content::DownloadManagerDelegate* | 364 content::DownloadManagerDelegate* |
362 AwBrowserContext::GetDownloadManagerDelegate() { | 365 AwBrowserContext::GetDownloadManagerDelegate() { |
363 return &download_manager_delegate_; | 366 return &download_manager_delegate_; |
364 } | 367 } |
365 | 368 |
366 content::BrowserPluginGuestManager* AwBrowserContext::GetGuestManager() { | 369 content::BrowserPluginGuestManager* AwBrowserContext::GetGuestManager() { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
457 return; | 460 return; |
458 // We don't care about commit_delay for now. It is just a dummy value. | 461 // We don't care about commit_delay for now. It is just a dummy value. |
459 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); | 462 base::TimeDelta commit_delay = base::TimeDelta::FromMinutes(60); |
460 data_reduction_proxy_service->EnableCompressionStatisticsLogging( | 463 data_reduction_proxy_service->EnableCompressionStatisticsLogging( |
461 user_pref_service_.get(), | 464 user_pref_service_.get(), |
462 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), | 465 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI), |
463 commit_delay); | 466 commit_delay); |
464 } | 467 } |
465 | 468 |
466 } // namespace android_webview | 469 } // namespace android_webview |
OLD | NEW |