Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(824)

Side by Side Diff: chrome/browser/profiles/profile_impl.cc

Issue 815983002: Topsites become keyedService based. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove extra inclusion from testing_profile.h Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/search/instant_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 20 matching lines...) Expand all
31 #include "chrome/browser/background/background_contents_service_factory.h" 31 #include "chrome/browser/background/background_contents_service_factory.h"
32 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 32 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
33 #include "chrome/browser/browser_process.h" 33 #include "chrome/browser/browser_process.h"
34 #include "chrome/browser/chrome_notification_types.h" 34 #include "chrome/browser/chrome_notification_types.h"
35 #include "chrome/browser/content_settings/cookie_settings.h" 35 #include "chrome/browser/content_settings/cookie_settings.h"
36 #include "chrome/browser/dom_distiller/profile_utils.h" 36 #include "chrome/browser/dom_distiller/profile_utils.h"
37 #include "chrome/browser/domain_reliability/service_factory.h" 37 #include "chrome/browser/domain_reliability/service_factory.h"
38 #include "chrome/browser/download/chrome_download_manager_delegate.h" 38 #include "chrome/browser/download/chrome_download_manager_delegate.h"
39 #include "chrome/browser/download/download_service.h" 39 #include "chrome/browser/download/download_service.h"
40 #include "chrome/browser/download/download_service_factory.h" 40 #include "chrome/browser/download/download_service_factory.h"
41 #include "chrome/browser/history/top_sites.h"
42 #include "chrome/browser/net/net_pref_observer.h" 41 #include "chrome/browser/net/net_pref_observer.h"
43 #include "chrome/browser/net/predictor.h" 42 #include "chrome/browser/net/predictor.h"
44 #include "chrome/browser/net/pref_proxy_config_tracker.h" 43 #include "chrome/browser/net/pref_proxy_config_tracker.h"
45 #include "chrome/browser/net/proxy_service_factory.h" 44 #include "chrome/browser/net/proxy_service_factory.h"
46 #include "chrome/browser/net/ssl_config_service_manager.h" 45 #include "chrome/browser/net/ssl_config_service_manager.h"
47 #include "chrome/browser/plugins/chrome_plugin_service_filter.h" 46 #include "chrome/browser/plugins/chrome_plugin_service_filter.h"
48 #include "chrome/browser/plugins/plugin_prefs.h" 47 #include "chrome/browser/plugins/plugin_prefs.h"
49 #include "chrome/browser/policy/profile_policy_connector.h" 48 #include "chrome/browser/policy/profile_policy_connector.h"
50 #include "chrome/browser/policy/profile_policy_connector_factory.h" 49 #include "chrome/browser/policy/profile_policy_connector_factory.h"
51 #include "chrome/browser/prefs/browser_prefs.h" 50 #include "chrome/browser/prefs/browser_prefs.h"
(...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 } else { 736 } else {
738 #if defined(ENABLE_EXTENSIONS) 737 #if defined(ENABLE_EXTENSIONS)
739 ExtensionPrefValueMapFactory::GetForBrowserContext(this)-> 738 ExtensionPrefValueMapFactory::GetForBrowserContext(this)->
740 ClearAllIncognitoSessionOnlyPreferences(); 739 ClearAllIncognitoSessionOnlyPreferences();
741 #endif 740 #endif
742 } 741 }
743 742
744 BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices( 743 BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices(
745 this); 744 this);
746 745
747 if (top_sites_.get())
748 top_sites_->Shutdown();
749
750 if (pref_proxy_config_tracker_) 746 if (pref_proxy_config_tracker_)
751 pref_proxy_config_tracker_->DetachFromPrefService(); 747 pref_proxy_config_tracker_->DetachFromPrefService();
752 748
753 if (host_content_settings_map_.get()) 749 if (host_content_settings_map_.get())
754 host_content_settings_map_->ShutdownOnUIThread(); 750 host_content_settings_map_->ShutdownOnUIThread();
755 751
756 // This causes the Preferences file to be written to disk. 752 // This causes the Preferences file to be written to disk.
757 if (prefs_loaded) 753 if (prefs_loaded)
758 SetExitType(EXIT_NORMAL); 754 SetExitType(EXIT_NORMAL);
759 } 755 }
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
1082 if (profile == static_cast<Profile*>(this)) 1078 if (profile == static_cast<Profile*>(this))
1083 return true; 1079 return true;
1084 Profile* otr_profile = off_the_record_profile_.get(); 1080 Profile* otr_profile = off_the_record_profile_.get();
1085 return otr_profile && profile == otr_profile; 1081 return otr_profile && profile == otr_profile;
1086 } 1082 }
1087 1083
1088 Time ProfileImpl::GetStartTime() const { 1084 Time ProfileImpl::GetStartTime() const {
1089 return start_time_; 1085 return start_time_;
1090 } 1086 }
1091 1087
1092 history::TopSites* ProfileImpl::GetTopSites() {
1093 if (!top_sites_.get()) {
1094 top_sites_ = history::TopSites::Create(
1095 this, GetPath().Append(chrome::kTopSitesFilename));
1096 }
1097 return top_sites_.get();
1098 }
1099
1100 history::TopSites* ProfileImpl::GetTopSitesWithoutCreating() {
1101 return top_sites_.get();
1102 }
1103
1104 #if defined(ENABLE_SESSION_SERVICE) 1088 #if defined(ENABLE_SESSION_SERVICE)
1105 void ProfileImpl::StopCreateSessionServiceTimer() { 1089 void ProfileImpl::StopCreateSessionServiceTimer() {
1106 create_session_service_timer_.Stop(); 1090 create_session_service_timer_.Stop();
1107 } 1091 }
1108 1092
1109 void ProfileImpl::EnsureSessionServiceCreated() { 1093 void ProfileImpl::EnsureSessionServiceCreated() {
1110 SessionServiceFactory::GetForProfile(this); 1094 SessionServiceFactory::GetForProfile(this);
1111 } 1095 }
1112 #endif 1096 #endif
1113 1097
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1339 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) { 1323 ProfileImpl::CreateDomainReliabilityMonitor(PrefService* local_state) {
1340 domain_reliability::DomainReliabilityService* service = 1324 domain_reliability::DomainReliabilityService* service =
1341 domain_reliability::DomainReliabilityServiceFactory::GetInstance()-> 1325 domain_reliability::DomainReliabilityServiceFactory::GetInstance()->
1342 GetForBrowserContext(this); 1326 GetForBrowserContext(this);
1343 if (!service) 1327 if (!service)
1344 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>(); 1328 return scoped_ptr<domain_reliability::DomainReliabilityMonitor>();
1345 1329
1346 return service->CreateMonitor( 1330 return service->CreateMonitor(
1347 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)); 1331 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO));
1348 } 1332 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/browser/search/instant_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698