OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/profile.h" | 5 #include "chrome/browser/profile.h" |
6 | 6 |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "app/theme_provider.h" | 8 #include "app/theme_provider.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/env_var.h" | 10 #include "base/env_var.h" |
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
632 return NULL; | 632 return NULL; |
633 } | 633 } |
634 | 634 |
635 virtual void MarkAsCleanShutdown() { | 635 virtual void MarkAsCleanShutdown() { |
636 } | 636 } |
637 | 637 |
638 virtual void InitExtensions() { | 638 virtual void InitExtensions() { |
639 NOTREACHED(); | 639 NOTREACHED(); |
640 } | 640 } |
641 | 641 |
642 virtual void InitWebResources() { | |
643 NOTREACHED(); | |
644 } | |
645 | |
646 virtual NTPResourceCache* GetNTPResourceCache() { | 642 virtual NTPResourceCache* GetNTPResourceCache() { |
647 // Just return the real profile resource cache. | 643 // Just return the real profile resource cache. |
648 return profile_->GetNTPResourceCache(); | 644 return profile_->GetNTPResourceCache(); |
649 } | 645 } |
650 | 646 |
651 virtual FilePath last_selected_directory() { | 647 virtual FilePath last_selected_directory() { |
652 const FilePath& directory = last_selected_directory_; | 648 const FilePath& directory = last_selected_directory_; |
653 if (directory.empty()) { | 649 if (directory.empty()) { |
654 return profile_->last_selected_directory(); | 650 return profile_->last_selected_directory(); |
655 } | 651 } |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 | 885 |
890 extensions_service_->Init(); | 886 extensions_service_->Init(); |
891 | 887 |
892 // Load any extensions specified with --load-extension. | 888 // Load any extensions specified with --load-extension. |
893 if (command_line->HasSwitch(switches::kLoadExtension)) { | 889 if (command_line->HasSwitch(switches::kLoadExtension)) { |
894 FilePath path = command_line->GetSwitchValuePath(switches::kLoadExtension); | 890 FilePath path = command_line->GetSwitchValuePath(switches::kLoadExtension); |
895 extensions_service_->LoadExtension(path); | 891 extensions_service_->LoadExtension(path); |
896 } | 892 } |
897 } | 893 } |
898 | 894 |
899 void ProfileImpl::InitWebResources() { | |
900 if (web_resource_service_) | |
901 return; // Already initialized. | |
902 | |
903 web_resource_service_ = new WebResourceService(this); | |
904 web_resource_service_->StartAfterDelay(); | |
905 } | |
906 | |
907 NTPResourceCache* ProfileImpl::GetNTPResourceCache() { | 895 NTPResourceCache* ProfileImpl::GetNTPResourceCache() { |
908 if (!ntp_resource_cache_.get()) | 896 if (!ntp_resource_cache_.get()) |
909 ntp_resource_cache_.reset(new NTPResourceCache(this)); | 897 ntp_resource_cache_.reset(new NTPResourceCache(this)); |
910 return ntp_resource_cache_.get(); | 898 return ntp_resource_cache_.get(); |
911 } | 899 } |
912 | 900 |
913 FilePath ProfileImpl::last_selected_directory() { | 901 FilePath ProfileImpl::last_selected_directory() { |
914 return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); | 902 return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); |
915 } | 903 } |
916 | 904 |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1661 new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); | 1649 new ProfileSyncFactoryImpl(this, CommandLine::ForCurrentProcess())); |
1662 sync_service_.reset( | 1650 sync_service_.reset( |
1663 profile_sync_factory_->CreateProfileSyncService()); | 1651 profile_sync_factory_->CreateProfileSyncService()); |
1664 sync_service_->Initialize(); | 1652 sync_service_->Initialize(); |
1665 } | 1653 } |
1666 | 1654 |
1667 void ProfileImpl::InitCloudPrintProxyService() { | 1655 void ProfileImpl::InitCloudPrintProxyService() { |
1668 cloud_print_proxy_service_.reset(new CloudPrintProxyService(this)); | 1656 cloud_print_proxy_service_.reset(new CloudPrintProxyService(this)); |
1669 cloud_print_proxy_service_->Initialize(); | 1657 cloud_print_proxy_service_->Initialize(); |
1670 } | 1658 } |
OLD | NEW |