diff options
Diffstat (limited to 'chrome/browser/profile.cc')
-rw-r--r-- | chrome/browser/profile.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index c0be2f9..b2bdf7f 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -215,6 +215,7 @@ void Profile::RegisterUserPrefs(PrefService* prefs) { prefs->RegisterDictionaryPref(prefs::kCurrentThemeTints); prefs->RegisterDictionaryPref(prefs::kCurrentThemeDisplayProperties); prefs->RegisterBooleanPref(prefs::kDisableExtensions, false); + prefs->RegisterStringPref(prefs::kSelectFileLastDirectory, L""); } // static @@ -583,6 +584,18 @@ class OffTheRecordProfileImpl : public Profile, return profile_->GetNTPResourceCache(); } + virtual FilePath last_selected_directory() { + const FilePath& directory = last_selected_directory_; + if (directory.empty()) { + return profile_->last_selected_directory(); + } + return directory; + } + + virtual void set_last_selected_directory(const FilePath& path) { + last_selected_directory_ = path; + } + virtual void ExitedOffTheRecordMode() { // Drop our download manager so we forget about all the downloads made // in off-the-record mode. @@ -648,6 +661,8 @@ class OffTheRecordProfileImpl : public Profile, // Should be used only on the file thread. scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; + FilePath last_selected_directory_; + DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImpl); }; @@ -824,6 +839,14 @@ NTPResourceCache* ProfileImpl::GetNTPResourceCache() { return ntp_resource_cache_.get(); } +FilePath ProfileImpl::last_selected_directory() { + return GetPrefs()->GetFilePath(prefs::kSelectFileLastDirectory); +} + +void ProfileImpl::set_last_selected_directory(const FilePath& path) { + GetPrefs()->SetFilePath(prefs::kSelectFileLastDirectory, path); +} + ProfileImpl::~ProfileImpl() { NotificationService::current()->Notify( NotificationType::PROFILE_DESTROYED, |