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

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
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/chrome_browser.gypi » ('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 "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 777 matching lines...) Expand 10 before | Expand all | Expand 10 after
788 } 788 }
789 789
790 HistoryService* ProfileImpl::GetHistoryService(ServiceAccessType sat) { 790 HistoryService* ProfileImpl::GetHistoryService(ServiceAccessType sat) {
791 return HistoryServiceFactory::GetForProfile(this, sat).get(); 791 return HistoryServiceFactory::GetForProfile(this, sat).get();
792 } 792 }
793 793
794 HistoryService* ProfileImpl::GetHistoryServiceWithoutCreating() { 794 HistoryService* ProfileImpl::GetHistoryServiceWithoutCreating() {
795 return HistoryServiceFactory::GetForProfileIfExists(this).get(); 795 return HistoryServiceFactory::GetForProfileIfExists(this).get();
796 } 796 }
797 797
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() { 798 DownloadManagerDelegate* ProfileImpl::GetDownloadManagerDelegate() {
809 return DownloadServiceFactory::GetForProfile(this)-> 799 return DownloadServiceFactory::GetForProfile(this)->
810 GetDownloadManagerDelegate(); 800 GetDownloadManagerDelegate();
811 } 801 }
812 802
813 bool ProfileImpl::DidLastSessionExitCleanly() { 803 bool ProfileImpl::DidLastSessionExitCleanly() {
814 // last_session_exited_cleanly_ is set when the preferences are loaded. Force 804 // last_session_exited_cleanly_ is set when the preferences are loaded. Force
815 // it to be set by asking for the prefs. 805 // it to be set by asking for the prefs.
816 GetPrefs(); 806 GetPrefs();
817 return last_session_exited_cleanly_; 807 return last_session_exited_cleanly_;
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
1115 if (!path.empty()) 1105 if (!path.empty())
1116 *cache_path = path; 1106 *cache_path = path;
1117 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : 1107 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) :
1118 prefs_->GetInteger(prefs::kDiskCacheSize); 1108 prefs_->GetInteger(prefs::kDiskCacheSize);
1119 } 1109 }
1120 1110
1121 base::Callback<ChromeURLDataManagerBackend*(void)> 1111 base::Callback<ChromeURLDataManagerBackend*(void)>
1122 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { 1112 ProfileImpl::GetChromeURLDataManagerBackendGetter() const {
1123 return io_data_.GetChromeURLDataManagerBackendGetter(); 1113 return io_data_.GetChromeURLDataManagerBackendGetter();
1124 } 1114 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_impl.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698