OLD | NEW |
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 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
804 // 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 |
805 // it to be set by asking for the prefs. | 805 // it to be set by asking for the prefs. |
806 GetPrefs(); | 806 GetPrefs(); |
807 return last_session_exited_cleanly_; | 807 return last_session_exited_cleanly_; |
808 } | 808 } |
809 | 809 |
810 quota::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() { | 810 quota::SpecialStoragePolicy* ProfileImpl::GetSpecialStoragePolicy() { |
811 return GetExtensionSpecialStoragePolicy(); | 811 return GetExtensionSpecialStoragePolicy(); |
812 } | 812 } |
813 | 813 |
| 814 bool ProfileImpl::ShouldSaveSessionStorageOnDisk() const { |
| 815 return CommandLine::ForCurrentProcess()->HasSwitch( |
| 816 switches::kEnableRestoreSessionState); |
| 817 } |
| 818 |
814 BookmarkModel* ProfileImpl::GetBookmarkModel() { | 819 BookmarkModel* ProfileImpl::GetBookmarkModel() { |
815 return BookmarkModelFactory::GetForProfile(this); | 820 return BookmarkModelFactory::GetForProfile(this); |
816 } | 821 } |
817 | 822 |
818 ProtocolHandlerRegistry* ProfileImpl::GetProtocolHandlerRegistry() { | 823 ProtocolHandlerRegistry* ProfileImpl::GetProtocolHandlerRegistry() { |
819 return protocol_handler_registry_.get(); | 824 return protocol_handler_registry_.get(); |
820 } | 825 } |
821 | 826 |
822 bool ProfileImpl::IsSameProfile(Profile* profile) { | 827 bool ProfileImpl::IsSameProfile(Profile* profile) { |
823 if (profile == static_cast<Profile*>(this)) | 828 if (profile == static_cast<Profile*>(this)) |
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1105 if (!path.empty()) | 1110 if (!path.empty()) |
1106 *cache_path = path; | 1111 *cache_path = path; |
1107 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : | 1112 *max_size = is_media_context ? prefs_->GetInteger(prefs::kMediaCacheSize) : |
1108 prefs_->GetInteger(prefs::kDiskCacheSize); | 1113 prefs_->GetInteger(prefs::kDiskCacheSize); |
1109 } | 1114 } |
1110 | 1115 |
1111 base::Callback<ChromeURLDataManagerBackend*(void)> | 1116 base::Callback<ChromeURLDataManagerBackend*(void)> |
1112 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { | 1117 ProfileImpl::GetChromeURLDataManagerBackendGetter() const { |
1113 return io_data_.GetChromeURLDataManagerBackendGetter(); | 1118 return io_data_.GetChromeURLDataManagerBackendGetter(); |
1114 } | 1119 } |
OLD | NEW |