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/profiles/profile_impl.h" | 5 #include "chrome/browser/profiles/profile_impl.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "base/strings/string_number_conversions.h" | 21 #include "base/strings/string_number_conversions.h" |
22 #include "base/strings/string_util.h" | 22 #include "base/strings/string_util.h" |
23 #include "base/strings/stringprintf.h" | 23 #include "base/strings/stringprintf.h" |
24 #include "base/strings/utf_string_conversions.h" | 24 #include "base/strings/utf_string_conversions.h" |
25 #include "base/synchronization/waitable_event.h" | 25 #include "base/synchronization/waitable_event.h" |
26 #include "base/threading/sequenced_worker_pool.h" | 26 #include "base/threading/sequenced_worker_pool.h" |
27 #include "base/version.h" | 27 #include "base/version.h" |
28 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 28 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
29 #include "chrome/browser/autocomplete/shortcuts_backend.h" | 29 #include "chrome/browser/autocomplete/shortcuts_backend.h" |
30 #include "chrome/browser/background/background_contents_service_factory.h" | 30 #include "chrome/browser/background/background_contents_service_factory.h" |
31 #include "chrome/browser/background/background_mode_manager.h" | |
32 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 31 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
33 #include "chrome/browser/browser_process.h" | 32 #include "chrome/browser/browser_process.h" |
34 #include "chrome/browser/chrome_notification_types.h" | 33 #include "chrome/browser/chrome_notification_types.h" |
35 #include "chrome/browser/content_settings/cookie_settings.h" | 34 #include "chrome/browser/content_settings/cookie_settings.h" |
36 #include "chrome/browser/content_settings/host_content_settings_map.h" | 35 #include "chrome/browser/content_settings/host_content_settings_map.h" |
37 #include "chrome/browser/dom_distiller/profile_utils.h" | 36 #include "chrome/browser/dom_distiller/profile_utils.h" |
38 #include "chrome/browser/domain_reliability/service_factory.h" | 37 #include "chrome/browser/domain_reliability/service_factory.h" |
39 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 38 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
40 #include "chrome/browser/download/download_service.h" | 39 #include "chrome/browser/download/download_service.h" |
41 #include "chrome/browser/download/download_service_factory.h" | 40 #include "chrome/browser/download/download_service_factory.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 #include "chrome/browser/media/protected_media_identifier_permission_context_fac
tory.h" | 109 #include "chrome/browser/media/protected_media_identifier_permission_context_fac
tory.h" |
111 #endif | 110 #endif |
112 | 111 |
113 #if defined(OS_CHROMEOS) | 112 #if defined(OS_CHROMEOS) |
114 #include "chrome/browser/chromeos/locale_change_guard.h" | 113 #include "chrome/browser/chromeos/locale_change_guard.h" |
115 #include "chrome/browser/chromeos/preferences.h" | 114 #include "chrome/browser/chromeos/preferences.h" |
116 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 115 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
117 #include "components/user_manager/user_manager.h" | 116 #include "components/user_manager/user_manager.h" |
118 #endif | 117 #endif |
119 | 118 |
| 119 #if defined(ENABLE_BACKGROUND) |
| 120 #include "chrome/browser/background/background_mode_manager.h" |
| 121 #endif |
| 122 |
120 #if defined(ENABLE_CONFIGURATION_POLICY) | 123 #if defined(ENABLE_CONFIGURATION_POLICY) |
121 #include "chrome/browser/policy/schema_registry_service.h" | 124 #include "chrome/browser/policy/schema_registry_service.h" |
122 #include "chrome/browser/policy/schema_registry_service_factory.h" | 125 #include "chrome/browser/policy/schema_registry_service_factory.h" |
123 #include "components/policy/core/browser/browser_policy_connector.h" | 126 #include "components/policy/core/browser/browser_policy_connector.h" |
124 #if defined(OS_CHROMEOS) | 127 #if defined(OS_CHROMEOS) |
125 #include "chrome/browser/chromeos/login/login_utils.h" | 128 #include "chrome/browser/chromeos/login/login_utils.h" |
126 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" | 129 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_chromeos.h" |
127 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" | 130 #include "chrome/browser/chromeos/policy/user_cloud_policy_manager_factory_chrom
eos.h" |
128 #else | 131 #else |
129 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" | 132 #include "chrome/browser/policy/cloud/user_cloud_policy_manager_factory.h" |
(...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 // the current value. | 570 // the current value. |
568 UpdateProfileUserNameCache(); | 571 UpdateProfileUserNameCache(); |
569 UpdateProfileSupervisedUserIdCache(); | 572 UpdateProfileSupervisedUserIdCache(); |
570 UpdateProfileIsEphemeralCache(); | 573 UpdateProfileIsEphemeralCache(); |
571 GAIAInfoUpdateServiceFactory::GetForProfile(this); | 574 GAIAInfoUpdateServiceFactory::GetForProfile(this); |
572 | 575 |
573 PrefService* local_state = g_browser_process->local_state(); | 576 PrefService* local_state = g_browser_process->local_state(); |
574 ssl_config_service_manager_.reset( | 577 ssl_config_service_manager_.reset( |
575 SSLConfigServiceManager::CreateDefaultManager(local_state)); | 578 SSLConfigServiceManager::CreateDefaultManager(local_state)); |
576 | 579 |
| 580 #if defined(ENABLE_BACKGROUND) |
577 // Initialize the BackgroundModeManager - this has to be done here before | 581 // Initialize the BackgroundModeManager - this has to be done here before |
578 // InitExtensions() is called because it relies on receiving notifications | 582 // InitExtensions() is called because it relies on receiving notifications |
579 // when extensions are loaded. BackgroundModeManager is not needed under | 583 // when extensions are loaded. BackgroundModeManager is not needed under |
580 // ChromeOS because Chrome is always running, no need for special keep-alive | 584 // ChromeOS because Chrome is always running, no need for special keep-alive |
581 // or launch-on-startup support unless kKeepAliveForTest is set. | 585 // or launch-on-startup support unless kKeepAliveForTest is set. |
582 bool init_background_mode_manager = true; | 586 bool init_background_mode_manager = true; |
583 #if defined(OS_CHROMEOS) | 587 #if defined(OS_CHROMEOS) |
584 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kKeepAliveForTest)) | 588 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kKeepAliveForTest)) |
585 init_background_mode_manager = false; | 589 init_background_mode_manager = false; |
586 #endif | 590 #endif |
587 if (init_background_mode_manager) { | 591 if (init_background_mode_manager) { |
588 if (g_browser_process->background_mode_manager()) | 592 if (g_browser_process->background_mode_manager()) |
589 g_browser_process->background_mode_manager()->RegisterProfile(this); | 593 g_browser_process->background_mode_manager()->RegisterProfile(this); |
590 } | 594 } |
| 595 #endif // defined(ENABLE_BACKGROUND) |
591 | 596 |
592 base::FilePath cookie_path = GetPath(); | 597 base::FilePath cookie_path = GetPath(); |
593 cookie_path = cookie_path.Append(chrome::kCookieFilename); | 598 cookie_path = cookie_path.Append(chrome::kCookieFilename); |
594 base::FilePath channel_id_path = GetPath(); | 599 base::FilePath channel_id_path = GetPath(); |
595 channel_id_path = channel_id_path.Append(chrome::kChannelIDFilename); | 600 channel_id_path = channel_id_path.Append(chrome::kChannelIDFilename); |
596 base::FilePath cache_path = base_cache_path_; | 601 base::FilePath cache_path = base_cache_path_; |
597 int cache_max_size; | 602 int cache_max_size; |
598 GetCacheParameters(false, &cache_path, &cache_max_size); | 603 GetCacheParameters(false, &cache_path, &cache_max_size); |
599 cache_path = GetCachePath(cache_path); | 604 cache_path = GetCachePath(cache_path); |
600 | 605 |
(...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1378 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { | 1383 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { |
1379 domain_reliability::DomainReliabilityService* service = | 1384 domain_reliability::DomainReliabilityService* service = |
1380 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> | 1385 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> |
1381 GetForBrowserContext(this); | 1386 GetForBrowserContext(this); |
1382 if (!service) | 1387 if (!service) |
1383 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); | 1388 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); |
1384 | 1389 |
1385 return service->CreateMonitor( | 1390 return service->CreateMonitor( |
1386 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); | 1391 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); |
1387 } | 1392 } |
OLD | NEW |