| 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/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/environment.h" | 9 #include "base/environment.h" |
| 10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
| 11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
| 13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
| 16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
| 17 #include "chrome/browser/autocomplete/autocomplete_classifier.h" | 17 #include "chrome/browser/autocomplete/autocomplete_classifier.h" |
| 18 #include "chrome/browser/autofill/personal_data_manager.h" | 18 #include "chrome/browser/autofill/personal_data_manager.h" |
| 19 #include "chrome/browser/background/background_contents_service_factory.h" | 19 #include "chrome/browser/background/background_contents_service_factory.h" |
| 20 #include "chrome/browser/background/background_mode_manager.h" | 20 #include "chrome/browser/background/background_mode_manager.h" |
| 21 #include "chrome/browser/bookmarks/bookmark_model.h" | 21 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 22 #include "chrome/browser/browser_process.h" | 22 #include "chrome/browser/browser_process.h" |
| 23 #include "chrome/browser/browser_signin.h" | |
| 24 #include "chrome/browser/browsing_data_remover.h" | 23 #include "chrome/browser/browsing_data_remover.h" |
| 25 #include "chrome/browser/content_settings/host_content_settings_map.h" | 24 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 26 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 25 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" |
| 27 #include "chrome/browser/defaults.h" | 26 #include "chrome/browser/defaults.h" |
| 28 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 27 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
| 29 #include "chrome/browser/extensions/extension_devtools_manager.h" | 28 #include "chrome/browser/extensions/extension_devtools_manager.h" |
| 30 #include "chrome/browser/extensions/extension_error_reporter.h" | 29 #include "chrome/browser/extensions/extension_error_reporter.h" |
| 31 #include "chrome/browser/extensions/extension_event_router.h" | 30 #include "chrome/browser/extensions/extension_event_router.h" |
| 32 #include "chrome/browser/extensions/extension_info_map.h" | 31 #include "chrome/browser/extensions/extension_info_map.h" |
| 33 #include "chrome/browser/extensions/extension_message_service.h" | 32 #include "chrome/browser/extensions/extension_message_service.h" |
| (...skipping 1503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1537 ProfileSyncService* ProfileImpl::GetProfileSyncService( | 1536 ProfileSyncService* ProfileImpl::GetProfileSyncService( |
| 1538 const std::string& cros_user) { | 1537 const std::string& cros_user) { |
| 1539 | 1538 |
| 1540 if (!ProfileSyncService::IsSyncEnabled()) | 1539 if (!ProfileSyncService::IsSyncEnabled()) |
| 1541 return NULL; | 1540 return NULL; |
| 1542 if (!sync_service_.get()) | 1541 if (!sync_service_.get()) |
| 1543 InitSyncService(cros_user); | 1542 InitSyncService(cros_user); |
| 1544 return sync_service_.get(); | 1543 return sync_service_.get(); |
| 1545 } | 1544 } |
| 1546 | 1545 |
| 1547 BrowserSignin* ProfileImpl::GetBrowserSignin() { | |
| 1548 if (!browser_signin_.get()) { | |
| 1549 browser_signin_.reset(new BrowserSignin(this)); | |
| 1550 } | |
| 1551 return browser_signin_.get(); | |
| 1552 } | |
| 1553 | |
| 1554 void ProfileImpl::InitSyncService(const std::string& cros_user) { | 1546 void ProfileImpl::InitSyncService(const std::string& cros_user) { |
| 1555 profile_sync_factory_.reset( | 1547 profile_sync_factory_.reset( |
| 1556 new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); | 1548 new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); |
| 1557 sync_service_.reset( | 1549 sync_service_.reset( |
| 1558 profile_sync_factory_->CreateProfileSyncService(cros_user)); | 1550 profile_sync_factory_->CreateProfileSyncService(cros_user)); |
| 1559 profile_sync_factory_->RegisterDataTypes(sync_service_.get()); | 1551 profile_sync_factory_->RegisterDataTypes(sync_service_.get()); |
| 1560 sync_service_->Initialize(); | 1552 sync_service_->Initialize(); |
| 1561 } | 1553 } |
| 1562 | 1554 |
| 1563 ChromeBlobStorageContext* ProfileImpl::GetBlobStorageContext() { | 1555 ChromeBlobStorageContext* ProfileImpl::GetBlobStorageContext() { |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1723 #endif | 1715 #endif |
| 1724 } | 1716 } |
| 1725 return prerender_manager_.get(); | 1717 return prerender_manager_.get(); |
| 1726 } | 1718 } |
| 1727 | 1719 |
| 1728 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { | 1720 SpellCheckProfile* ProfileImpl::GetSpellCheckProfile() { |
| 1729 if (!spellcheck_profile_.get()) | 1721 if (!spellcheck_profile_.get()) |
| 1730 spellcheck_profile_.reset(new SpellCheckProfile()); | 1722 spellcheck_profile_.reset(new SpellCheckProfile()); |
| 1731 return spellcheck_profile_.get(); | 1723 return spellcheck_profile_.get(); |
| 1732 } | 1724 } |
| OLD | NEW |