| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/environment.h" | 10 #include "base/environment.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 #include "chrome/browser/prerender/prerender_manager_factory.h" | 65 #include "chrome/browser/prerender/prerender_manager_factory.h" |
| 66 #include "chrome/browser/profiles/profile_dependency_manager.h" | 66 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 67 #include "chrome/browser/profiles/profile_info_cache.h" | 67 #include "chrome/browser/profiles/profile_info_cache.h" |
| 68 #include "chrome/browser/profiles/profile_manager.h" | 68 #include "chrome/browser/profiles/profile_manager.h" |
| 69 #include "chrome/browser/search_engines/template_url_fetcher.h" | 69 #include "chrome/browser/search_engines/template_url_fetcher.h" |
| 70 #include "chrome/browser/search_engines/template_url_service.h" | 70 #include "chrome/browser/search_engines/template_url_service.h" |
| 71 #include "chrome/browser/sessions/session_service_factory.h" | 71 #include "chrome/browser/sessions/session_service_factory.h" |
| 72 #include "chrome/browser/speech/chrome_speech_input_manager.h" | 72 #include "chrome/browser/speech/chrome_speech_input_manager.h" |
| 73 #include "chrome/browser/speech/chrome_speech_input_preferences.h" | 73 #include "chrome/browser/speech/chrome_speech_input_preferences.h" |
| 74 #include "chrome/browser/spellchecker/spellcheck_profile.h" | 74 #include "chrome/browser/spellchecker/spellcheck_profile.h" |
| 75 #include "chrome/browser/sync/profile_sync_factory_impl.h" | 75 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" |
| 76 #include "chrome/browser/sync/profile_sync_service.h" | 76 #include "chrome/browser/sync/profile_sync_service.h" |
| 77 #include "chrome/browser/tabs/pinned_tab_service_factory.h" | 77 #include "chrome/browser/tabs/pinned_tab_service_factory.h" |
| 78 #include "chrome/browser/transport_security_persister.h" | 78 #include "chrome/browser/transport_security_persister.h" |
| 79 #include "chrome/browser/ui/browser_list.h" | 79 #include "chrome/browser/ui/browser_list.h" |
| 80 #include "chrome/browser/ui/find_bar/find_bar_state.h" | 80 #include "chrome/browser/ui/find_bar/find_bar_state.h" |
| 81 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 81 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 82 #include "chrome/browser/ui/webui/extension_icon_source.h" | 82 #include "chrome/browser/ui/webui/extension_icon_source.h" |
| 83 #include "chrome/browser/user_style_sheet_watcher.h" | 83 #include "chrome/browser/user_style_sheet_watcher.h" |
| 84 #include "chrome/browser/visitedlink/visitedlink_event_listener.h" | 84 #include "chrome/browser/visitedlink/visitedlink_event_listener.h" |
| 85 #include "chrome/browser/visitedlink/visitedlink_master.h" | 85 #include "chrome/browser/visitedlink/visitedlink_master.h" |
| (...skipping 1258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1344 | 1344 |
| 1345 if (!ProfileSyncService::IsSyncEnabled()) | 1345 if (!ProfileSyncService::IsSyncEnabled()) |
| 1346 return NULL; | 1346 return NULL; |
| 1347 if (!sync_service_.get()) | 1347 if (!sync_service_.get()) |
| 1348 InitSyncService(cros_user); | 1348 InitSyncService(cros_user); |
| 1349 return sync_service_.get(); | 1349 return sync_service_.get(); |
| 1350 } | 1350 } |
| 1351 | 1351 |
| 1352 void ProfileImpl::InitSyncService(const std::string& cros_user) { | 1352 void ProfileImpl::InitSyncService(const std::string& cros_user) { |
| 1353 profile_sync_factory_.reset( | 1353 profile_sync_factory_.reset( |
| 1354 new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); | 1354 new ProfileSyncComponentsFactoryImpl(this, |
| 1355 CommandLine::ForCurrentProcess())); |
| 1355 sync_service_.reset( | 1356 sync_service_.reset( |
| 1356 profile_sync_factory_->CreateProfileSyncService(cros_user)); | 1357 profile_sync_factory_->CreateProfileSyncService(cros_user)); |
| 1357 profile_sync_factory_->RegisterDataTypes(sync_service_.get()); | 1358 profile_sync_factory_->RegisterDataTypes(sync_service_.get()); |
| 1358 sync_service_->Initialize(); | 1359 sync_service_->Initialize(); |
| 1359 | 1360 |
| 1360 UpdateProfileUserNameCache(); | 1361 UpdateProfileUserNameCache(); |
| 1361 } | 1362 } |
| 1362 | 1363 |
| 1363 ChromeBlobStorageContext* ProfileImpl::GetBlobStorageContext() { | 1364 ChromeBlobStorageContext* ProfileImpl::GetBlobStorageContext() { |
| 1364 if (!blob_storage_context_) { | 1365 if (!blob_storage_context_) { |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1576 FilePath* cache_path, | 1577 FilePath* cache_path, |
| 1577 int* max_size) { | 1578 int* max_size) { |
| 1578 DCHECK(cache_path); | 1579 DCHECK(cache_path); |
| 1579 DCHECK(max_size); | 1580 DCHECK(max_size); |
| 1580 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); | 1581 FilePath path(prefs_->GetFilePath(prefs::kDiskCacheDir)); |
| 1581 if (!path.empty()) | 1582 if (!path.empty()) |
| 1582 *cache_path = path; | 1583 *cache_path = path; |
| 1583 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1584 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
| 1584 prefs_->GetInteger(prefs::kDiskCacheSize); | 1585 prefs_->GetInteger(prefs::kDiskCacheSize); |
| 1585 } | 1586 } |
| OLD | NEW |