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

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

Issue 10701043: Make ShortcutsBackend a ProfileKeyedService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
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 "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 24 matching lines...) Expand all
35 #include "chrome/browser/extensions/extension_process_manager.h" 35 #include "chrome/browser/extensions/extension_process_manager.h"
36 #include "chrome/browser/extensions/extension_service.h" 36 #include "chrome/browser/extensions/extension_service.h"
37 #include "chrome/browser/extensions/extension_special_storage_policy.h" 37 #include "chrome/browser/extensions/extension_special_storage_policy.h"
38 #include "chrome/browser/extensions/extension_system.h" 38 #include "chrome/browser/extensions/extension_system.h"
39 #include "chrome/browser/extensions/user_script_master.h" 39 #include "chrome/browser/extensions/user_script_master.h"
40 #include "chrome/browser/favicon/favicon_service.h" 40 #include "chrome/browser/favicon/favicon_service.h"
41 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h" 41 #include "chrome/browser/geolocation/chrome_geolocation_permission_context.h"
42 #include "chrome/browser/history/history.h" 42 #include "chrome/browser/history/history.h"
43 #include "chrome/browser/history/history_service_factory.h" 43 #include "chrome/browser/history/history_service_factory.h"
44 #include "chrome/browser/history/shortcuts_backend.h" 44 #include "chrome/browser/history/shortcuts_backend.h"
45 #include "chrome/browser/history/shortcuts_backend_factory.h"
Miranda Callahan 2012/07/03 15:23:41 does this need to be added?
mrossetti 2012/07/03 16:42:29 No, removed.
45 #include "chrome/browser/history/top_sites.h" 46 #include "chrome/browser/history/top_sites.h"
46 #include "chrome/browser/instant/instant_controller.h" 47 #include "chrome/browser/instant/instant_controller.h"
47 #include "chrome/browser/metrics/metrics_service.h" 48 #include "chrome/browser/metrics/metrics_service.h"
48 #include "chrome/browser/net/chrome_url_request_context.h" 49 #include "chrome/browser/net/chrome_url_request_context.h"
49 #include "chrome/browser/net/net_pref_observer.h" 50 #include "chrome/browser/net/net_pref_observer.h"
50 #include "chrome/browser/net/predictor.h" 51 #include "chrome/browser/net/predictor.h"
51 #include "chrome/browser/net/proxy_service_factory.h" 52 #include "chrome/browser/net/proxy_service_factory.h"
52 #include "chrome/browser/net/ssl_config_service_manager.h" 53 #include "chrome/browser/net/ssl_config_service_manager.h"
53 #include "chrome/browser/net/url_fixer_upper.h" 54 #include "chrome/browser/net/url_fixer_upper.h"
54 #include "chrome/browser/plugin_prefs.h" 55 #include "chrome/browser/plugin_prefs.h"
(...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 } 789 }
789 790
790 HistoryService* ProfileImpl::GetHistoryService(ServiceAccessType sat) { 791 HistoryService* ProfileImpl::GetHistoryService(ServiceAccessType sat) {
791 return HistoryServiceFactory::GetForProfile(this, sat).get(); 792 return HistoryServiceFactory::GetForProfile(this, sat).get();
792 } 793 }
793 794
794 HistoryService* ProfileImpl::GetHistoryServiceWithoutCreating() { 795 HistoryService* ProfileImpl::GetHistoryServiceWithoutCreating() {
795 return HistoryServiceFactory::GetForProfileIfExists(this).get(); 796 return HistoryServiceFactory::GetForProfileIfExists(this).get();
796 } 797 }
797 798
798 history::ShortcutsBackend* ProfileImpl::GetShortcutsBackend() {
799 // This is called on one thread only - UI, so no magic is needed to protect
800 // against the multiple concurrent calls.
801 if (!shortcuts_backend_.get()) {
802 shortcuts_backend_ = new history::ShortcutsBackend(GetPath(), this);
803 CHECK(shortcuts_backend_->Init());
804 }
805 return shortcuts_backend_.get();
806 }
807
808 DownloadManagerDelegate* ProfileImpl::GetDownloadManagerDelegate() { 799 DownloadManagerDelegate* ProfileImpl::GetDownloadManagerDelegate() {
809 return DownloadServiceFactory::GetForProfile(this)-> 800 return DownloadServiceFactory::GetForProfile(this)->
810 GetDownloadManagerDelegate(); 801 GetDownloadManagerDelegate();
811 } 802 }
812 803
813 bool ProfileImpl::DidLastSessionExitCleanly() { 804 bool ProfileImpl::DidLastSessionExitCleanly() {
814 // last_session_exited_cleanly_ is set when the preferences are loaded. Force 805 // last_session_exited_cleanly_ is set when the preferences are loaded. Force
815 // it to be set by asking for the prefs. 806 // it to be set by asking for the prefs.
816 GetPrefs(); 807 GetPrefs();
817 return last_session_exited_cleanly_; 808 return last_session_exited_cleanly_;
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 if (!path.empty()) 1106 if (!path.empty())
1116 *cache_path = path; 1107 *cache_path = path;
1117 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : 1108 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) :
1118 prefs_->GetInteger(prefs::kDiskCacheSize); 1109 prefs_->GetInteger(prefs::kDiskCacheSize);
1119 } 1110 }
1120 1111
1121 base::Callback<ChromeURLDataManagerBackend*(void)> 1112 base::Callback<ChromeURLDataManagerBackend*(void)>
1122 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { 1113 ProfileImpl::GetChromeURLDataManagerBackendGetter() const {
1123 return io_data_.GetChromeURLDataManagerBackendGetter(); 1114 return io_data_.GetChromeURLDataManagerBackendGetter();
1124 } 1115 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698