[email protected] | e284e6d8 | 2010-01-29 19:49:45 | [diff] [blame] | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
license.bot | bf09a50 | 2008-08-24 00:55:55 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 4 | |
| 5 | #include "chrome/browser/profile.h" |
| 6 | |
[email protected] | 1952c7d | 2010-03-04 23:48:34 | [diff] [blame] | 7 | #include "app/resource_bundle.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 8 | #include "base/command_line.h" |
[email protected] | 04fba9a9 | 2008-10-28 17:25:25 | [diff] [blame] | 9 | #include "base/file_path.h" |
[email protected] | 405a64b | 2009-09-16 21:03:44 | [diff] [blame] | 10 | #include "base/file_util.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 11 | #include "base/path_service.h" |
| 12 | #include "base/scoped_ptr.h" |
| 13 | #include "base/string_util.h" |
[email protected] | 398206c | 2010-06-21 01:46:08 | [diff] [blame] | 14 | #include "chrome/browser/background_contents_service.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 15 | #include "chrome/browser/browser_list.h" |
[email protected] | 8a4892d8d | 2009-11-23 20:40:57 | [diff] [blame] | 16 | #include "chrome/browser/browser_process.h" |
[email protected] | 22339b1 | 2010-08-27 18:29:24 | [diff] [blame] | 17 | #include "chrome/browser/chrome_blob_storage_context.h" |
[email protected] | 6fad263 | 2009-11-02 05:59:37 | [diff] [blame] | 18 | #include "chrome/browser/chrome_thread.h" |
[email protected] | b7f0588 | 2009-02-22 01:21:56 | [diff] [blame] | 19 | #include "chrome/browser/download/download_manager.h" |
[email protected] | c44b790 | 2010-08-27 21:24:43 | [diff] [blame] | 20 | #include "chrome/browser/file_system/file_system_host_context.h" |
[email protected] | bc535ee5 | 2010-08-31 18:40:32 | [diff] [blame] | 21 | #include "chrome/browser/extensions/extension_message_service.h" |
| 22 | #include "chrome/browser/extensions/extension_process_manager.h" |
[email protected] | e5d2f713 | 2010-04-09 18:13:53 | [diff] [blame] | 23 | #include "chrome/browser/find_bar_state.h" |
[email protected] | 3bf335a | 2009-06-26 20:46:06 | [diff] [blame] | 24 | #include "chrome/browser/in_process_webkit/webkit_context.h" |
[email protected] | 6ab9b20 | 2008-12-23 22:34:50 | [diff] [blame] | 25 | #include "chrome/browser/net/chrome_url_request_context.h" |
[email protected] | 4bb33630 | 2009-10-12 05:44:26 | [diff] [blame] | 26 | #include "chrome/browser/notifications/desktop_notification_service.h" |
[email protected] | 1132436e | 2009-04-08 20:06:33 | [diff] [blame] | 27 | #include "chrome/browser/ssl/ssl_host_state.h" |
[email protected] | 48352c1 | 2009-08-15 01:19:11 | [diff] [blame] | 28 | #include "chrome/browser/sync/profile_sync_service.h" |
[email protected] | b071b6c | 2010-08-25 20:28:03 | [diff] [blame] | 29 | #include "chrome/browser/themes/browser_theme_provider.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 30 | #include "chrome/common/chrome_constants.h" |
| 31 | #include "chrome/common/chrome_paths.h" |
| 32 | #include "chrome/common/chrome_switches.h" |
[email protected] | ea587b0 | 2010-05-21 15:01:35 | [diff] [blame] | 33 | #include "chrome/common/json_pref_store.h" |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 34 | #include "chrome/common/notification_service.h" |
| 35 | #include "chrome/common/pref_names.h" |
[email protected] | f7011fcb | 2009-01-28 21:54:32 | [diff] [blame] | 36 | #include "chrome/common/render_messages.h" |
[email protected] | 1952c7d | 2010-03-04 23:48:34 | [diff] [blame] | 37 | #include "grit/browser_resources.h" |
[email protected] | f90f5c51 | 2009-02-18 19:10:58 | [diff] [blame] | 38 | #include "grit/locale_settings.h" |
[email protected] | 326e679 | 2009-12-11 21:04:42 | [diff] [blame] | 39 | #include "net/base/transport_security_state.h" |
[email protected] | 2f351cb | 2009-11-09 23:43:34 | [diff] [blame] | 40 | #include "webkit/database/database_tracker.h" |
[email protected] | 753efc4 | 2010-03-09 19:52:16 | [diff] [blame] | 41 | #if defined(TOOLKIT_USES_GTK) |
[email protected] | a5166af6 | 2009-07-03 00:42:29 | [diff] [blame] | 42 | #include "chrome/browser/gtk/gtk_theme_provider.h" |
| 43 | #endif |
| 44 | |
[email protected] | 5a0b42e | 2010-07-30 23:42:59 | [diff] [blame] | 45 | #if defined(OS_WIN) |
| 46 | #include "chrome/browser/password_manager/password_store_win.h" |
| 47 | #elif defined(OS_MACOSX) |
| 48 | #include "chrome/browser/keychain_mac.h" |
| 49 | #include "chrome/browser/password_manager/password_store_mac.h" |
| 50 | #elif defined(OS_POSIX) && !defined(OS_CHROMEOS) |
[email protected] | 5a0b42e | 2010-07-30 23:42:59 | [diff] [blame] | 51 | #include "chrome/browser/password_manager/native_backend_gnome_x.h" |
| 52 | #include "chrome/browser/password_manager/native_backend_kwallet_x.h" |
| 53 | #include "chrome/browser/password_manager/password_store_x.h" |
| 54 | #endif |
| 55 | |
[email protected] | e1acf6f | 2008-10-27 20:43:33 | [diff] [blame] | 56 | using base::Time; |
| 57 | using base::TimeDelta; |
| 58 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 59 | // A pointer to the request context for the default profile. See comments on |
| 60 | // Profile::GetDefaultRequestContext. |
[email protected] | be180c80 | 2009-10-23 06:33:31 | [diff] [blame] | 61 | URLRequestContextGetter* Profile::default_request_context_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 62 | |
[email protected] | 5a0b42e | 2010-07-30 23:42:59 | [diff] [blame] | 63 | namespace { |
| 64 | |
| 65 | // FIXME: Duplicated in profile_impl.cc |
| 66 | void CleanupRequestContext(ChromeURLRequestContextGetter* context) { |
[email protected] | 13c3092 | 2009-11-19 03:43:19 | [diff] [blame] | 67 | if (context) |
[email protected] | 47accfd6 | 2009-05-14 18:46:21 | [diff] [blame] | 68 | context->CleanupOnUIThread(); |
[email protected] | 47accfd6 | 2009-05-14 18:46:21 | [diff] [blame] | 69 | } |
| 70 | |
[email protected] | 5a0b42e | 2010-07-30 23:42:59 | [diff] [blame] | 71 | } // namespace |
| 72 | |
[email protected] | 34cc84f | 2009-02-13 10:04:35 | [diff] [blame] | 73 | // static |
[email protected] | 4bf6afd | 2009-10-08 14:00:11 | [diff] [blame] | 74 | const ProfileId Profile::InvalidProfileId = static_cast<ProfileId>(0); |
| 75 | |
| 76 | // static |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 77 | void Profile::RegisterUserPrefs(PrefService* prefs) { |
[email protected] | 430d3f7 | 2008-10-27 17:56:55 | [diff] [blame] | 78 | prefs->RegisterBooleanPref(prefs::kSearchSuggestEnabled, true); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 79 | prefs->RegisterBooleanPref(prefs::kSessionExitedCleanly, true); |
| 80 | prefs->RegisterBooleanPref(prefs::kSafeBrowsingEnabled, true); |
[email protected] | 74c8b42 | 2009-03-11 00:34:12 | [diff] [blame] | 81 | // TODO(estade): IDS_SPELLCHECK_DICTIONARY should be an ASCII string. |
[email protected] | e7244d8 | 2008-10-29 18:13:26 | [diff] [blame] | 82 | prefs->RegisterLocalizedStringPref(prefs::kSpellCheckDictionary, |
| 83 | IDS_SPELLCHECK_DICTIONARY); |
| 84 | prefs->RegisterBooleanPref(prefs::kEnableSpellCheck, true); |
[email protected] | 154a433 | 2009-06-03 20:20:58 | [diff] [blame] | 85 | prefs->RegisterBooleanPref(prefs::kEnableAutoSpellCorrect, true); |
[email protected] | 753efc4 | 2010-03-09 19:52:16 | [diff] [blame] | 86 | #if defined(TOOLKIT_USES_GTK) |
[email protected] | 88c50ab | 2010-03-26 20:04:06 | [diff] [blame] | 87 | prefs->RegisterBooleanPref(prefs::kUsesSystemTheme, |
| 88 | GtkThemeProvider::DefaultUsesSystemTheme()); |
[email protected] | a5166af6 | 2009-07-03 00:42:29 | [diff] [blame] | 89 | #endif |
[email protected] | f017cc9 | 2009-12-14 20:48:07 | [diff] [blame] | 90 | prefs->RegisterFilePathPref(prefs::kCurrentThemePackFilename, FilePath()); |
[email protected] | 51c490b | 2009-08-03 16:34:34 | [diff] [blame] | 91 | prefs->RegisterStringPref(prefs::kCurrentThemeID, |
[email protected] | 20ce516d | 2010-06-18 02:20:04 | [diff] [blame] | 92 | BrowserThemeProvider::kDefaultThemeID); |
[email protected] | 4a19063 | 2009-05-09 01:07:42 | [diff] [blame] | 93 | prefs->RegisterDictionaryPref(prefs::kCurrentThemeImages); |
| 94 | prefs->RegisterDictionaryPref(prefs::kCurrentThemeColors); |
| 95 | prefs->RegisterDictionaryPref(prefs::kCurrentThemeTints); |
[email protected] | 7895ea2 | 2009-06-02 20:53:50 | [diff] [blame] | 96 | prefs->RegisterDictionaryPref(prefs::kCurrentThemeDisplayProperties); |
[email protected] | 6d60703b | 2009-08-29 01:29:23 | [diff] [blame] | 97 | prefs->RegisterBooleanPref(prefs::kDisableExtensions, false); |
[email protected] | 20ce516d | 2010-06-18 02:20:04 | [diff] [blame] | 98 | prefs->RegisterStringPref(prefs::kSelectFileLastDirectory, ""); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 99 | } |
| 100 | |
[email protected] | 34cc84f | 2009-02-13 10:04:35 | [diff] [blame] | 101 | // static |
[email protected] | be180c80 | 2009-10-23 06:33:31 | [diff] [blame] | 102 | URLRequestContextGetter* Profile::GetDefaultRequestContext() { |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 103 | return default_request_context_; |
| 104 | } |
| 105 | |
[email protected] | d3b98c8 | 2010-07-14 07:45:59 | [diff] [blame] | 106 | bool Profile::IsSyncAccessible() { |
| 107 | ProfileSyncService* syncService = GetProfileSyncService(); |
| 108 | return syncService && !syncService->IsManaged(); |
| 109 | } |
| 110 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 111 | //////////////////////////////////////////////////////////////////////////////// |
| 112 | // |
| 113 | // OffTheRecordProfileImpl is a profile subclass that wraps an existing profile |
[email protected] | 4a19063 | 2009-05-09 01:07:42 | [diff] [blame] | 114 | // to make it suitable for the off the record mode. |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 115 | // |
| 116 | //////////////////////////////////////////////////////////////////////////////// |
| 117 | class OffTheRecordProfileImpl : public Profile, |
| 118 | public NotificationObserver { |
| 119 | public: |
| 120 | explicit OffTheRecordProfileImpl(Profile* real_profile) |
| 121 | : profile_(real_profile), |
| 122 | start_time_(Time::Now()) { |
[email protected] | be180c80 | 2009-10-23 06:33:31 | [diff] [blame] | 123 | request_context_ = ChromeURLRequestContextGetter::CreateOffTheRecord(this); |
[email protected] | bc535ee5 | 2010-08-31 18:40:32 | [diff] [blame] | 124 | extension_process_manager_.reset(ExtensionProcessManager::Create(this)); |
[email protected] | 481e1a4 | 2009-05-06 20:56:05 | [diff] [blame] | 125 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 126 | // Register for browser close notifications so we can detect when the last |
| 127 | // off-the-record window is closed, in which case we can clean our states |
| 128 | // (cookies, downloads...). |
[email protected] | 88cf329 | 2009-05-22 01:48:43 | [diff] [blame] | 129 | registrar_.Add(this, NotificationType::BROWSER_CLOSED, |
| 130 | NotificationService::AllSources()); |
[email protected] | 398206c | 2010-06-21 01:46:08 | [diff] [blame] | 131 | background_contents_service_.reset( |
| 132 | new BackgroundContentsService(this, CommandLine::ForCurrentProcess())); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 133 | } |
| 134 | |
| 135 | virtual ~OffTheRecordProfileImpl() { |
[email protected] | a04876b9 | 2010-06-11 22:53:43 | [diff] [blame] | 136 | NotificationService::current()->Notify(NotificationType::PROFILE_DESTROYED, |
| 137 | Source<Profile>(this), |
| 138 | NotificationService::NoDetails()); |
| 139 | CleanupRequestContext(request_context_); |
[email protected] | bc535ee5 | 2010-08-31 18:40:32 | [diff] [blame] | 140 | CleanupRequestContext(extensions_request_context_); |
[email protected] | fe615f3 | 2010-06-13 09:08:41 | [diff] [blame] | 141 | |
| 142 | // Clean up all DB files/directories |
| 143 | ChromeThread::PostTask( |
| 144 | ChromeThread::FILE, FROM_HERE, |
| 145 | NewRunnableMethod( |
| 146 | db_tracker_.get(), |
| 147 | &webkit_database::DatabaseTracker::DeleteIncognitoDBDirectory)); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 148 | } |
| 149 | |
[email protected] | 4bf6afd | 2009-10-08 14:00:11 | [diff] [blame] | 150 | virtual ProfileId GetRuntimeId() { |
| 151 | return reinterpret_cast<ProfileId>(this); |
| 152 | } |
| 153 | |
[email protected] | a6d0f18 | 2010-01-12 08:01:44 | [diff] [blame] | 154 | virtual FilePath GetPath() { return profile_->GetPath(); } |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 155 | |
| 156 | virtual bool IsOffTheRecord() { |
| 157 | return true; |
| 158 | } |
| 159 | |
| 160 | virtual Profile* GetOffTheRecordProfile() { |
| 161 | return this; |
| 162 | } |
| 163 | |
[email protected] | 860f5549 | 2009-03-27 19:50:59 | [diff] [blame] | 164 | virtual void DestroyOffTheRecordProfile() { |
| 165 | // Suicide is bad! |
| 166 | NOTREACHED(); |
| 167 | } |
| 168 | |
[email protected] | 6c8909c | 2010-07-02 07:31:11 | [diff] [blame] | 169 | virtual bool HasOffTheRecordProfile() { |
| 170 | return true; |
| 171 | } |
| 172 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 173 | virtual Profile* GetOriginalProfile() { |
| 174 | return profile_; |
| 175 | } |
| 176 | |
[email protected] | 02a5cdb | 2010-08-11 20:47:32 | [diff] [blame] | 177 | virtual ChromeAppCacheService* GetAppCacheService() { |
| 178 | if (!appcache_service_) { |
| 179 | appcache_service_ = new ChromeAppCacheService; |
| 180 | ChromeThread::PostTask( |
| 181 | ChromeThread::IO, FROM_HERE, |
| 182 | NewRunnableMethod(appcache_service_.get(), |
| 183 | &ChromeAppCacheService::InitializeOnIOThread, |
| 184 | GetPath(), IsOffTheRecord(), |
| 185 | make_scoped_refptr(GetHostContentSettingsMap()))); |
| 186 | } |
| 187 | return appcache_service_; |
| 188 | } |
| 189 | |
[email protected] | 2f351cb | 2009-11-09 23:43:34 | [diff] [blame] | 190 | virtual webkit_database::DatabaseTracker* GetDatabaseTracker() { |
[email protected] | fe615f3 | 2010-06-13 09:08:41 | [diff] [blame] | 191 | if (!db_tracker_) { |
| 192 | db_tracker_ = new webkit_database::DatabaseTracker( |
| 193 | GetPath(), IsOffTheRecord()); |
| 194 | } |
[email protected] | 2f351cb | 2009-11-09 23:43:34 | [diff] [blame] | 195 | return db_tracker_; |
| 196 | } |
| 197 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 198 | virtual VisitedLinkMaster* GetVisitedLinkMaster() { |
[email protected] | 7fb6c86 | 2009-03-13 02:51:49 | [diff] [blame] | 199 | // We don't provide access to the VisitedLinkMaster when we're OffTheRecord |
| 200 | // because we don't want to leak the sites that the user has visited before. |
| 201 | return NULL; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 202 | } |
| 203 | |
[email protected] | 6014d67 | 2008-12-05 00:38:25 | [diff] [blame] | 204 | virtual ExtensionsService* GetExtensionsService() { |
[email protected] | 55a3569 | 2010-02-11 23:25:21 | [diff] [blame] | 205 | return GetOriginalProfile()->GetExtensionsService(); |
[email protected] | 6014d67 | 2008-12-05 00:38:25 | [diff] [blame] | 206 | } |
| 207 | |
[email protected] | 398206c | 2010-06-21 01:46:08 | [diff] [blame] | 208 | virtual BackgroundContentsService* GetBackgroundContentsService() { |
| 209 | return background_contents_service_.get(); |
| 210 | } |
| 211 | |
[email protected] | 4c793f0 | 2010-08-18 20:55:45 | [diff] [blame] | 212 | virtual StatusTray* GetStatusTray() { |
| 213 | return GetOriginalProfile()->GetStatusTray(); |
| 214 | } |
| 215 | |
[email protected] | 0938d3c | 2009-01-09 20:37:35 | [diff] [blame] | 216 | virtual UserScriptMaster* GetUserScriptMaster() { |
[email protected] | 55a3569 | 2010-02-11 23:25:21 | [diff] [blame] | 217 | return GetOriginalProfile()->GetUserScriptMaster(); |
[email protected] | 04fba9a9 | 2008-10-28 17:25:25 | [diff] [blame] | 218 | } |
| 219 | |
[email protected] | 89ebc7e | 2009-08-24 22:11:07 | [diff] [blame] | 220 | virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() { |
[email protected] | 55a3569 | 2010-02-11 23:25:21 | [diff] [blame] | 221 | // TODO(mpcomplete): figure out whether we should return the original |
| 222 | // profile's version. |
[email protected] | 89ebc7e | 2009-08-24 22:11:07 | [diff] [blame] | 223 | return NULL; |
| 224 | } |
| 225 | |
[email protected] | 481e1a4 | 2009-05-06 20:56:05 | [diff] [blame] | 226 | virtual ExtensionProcessManager* GetExtensionProcessManager() { |
[email protected] | bc535ee5 | 2010-08-31 18:40:32 | [diff] [blame] | 227 | return extension_process_manager_.get(); |
[email protected] | 481e1a4 | 2009-05-06 20:56:05 | [diff] [blame] | 228 | } |
| 229 | |
[email protected] | 7120f13 | 2009-07-20 21:05:37 | [diff] [blame] | 230 | virtual ExtensionMessageService* GetExtensionMessageService() { |
[email protected] | 55a3569 | 2010-02-11 23:25:21 | [diff] [blame] | 231 | return GetOriginalProfile()->GetExtensionMessageService(); |
[email protected] | 7120f13 | 2009-07-20 21:05:37 | [diff] [blame] | 232 | } |
| 233 | |
[email protected] | 34cc84f | 2009-02-13 10:04:35 | [diff] [blame] | 234 | virtual SSLHostState* GetSSLHostState() { |
| 235 | if (!ssl_host_state_.get()) |
| 236 | ssl_host_state_.reset(new SSLHostState()); |
| 237 | |
| 238 | DCHECK(ssl_host_state_->CalledOnValidThread()); |
| 239 | return ssl_host_state_.get(); |
| 240 | } |
| 241 | |
[email protected] | 326e679 | 2009-12-11 21:04:42 | [diff] [blame] | 242 | virtual net::TransportSecurityState* GetTransportSecurityState() { |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 243 | if (!transport_security_state_.get()) |
| 244 | transport_security_state_ = new net::TransportSecurityState(); |
[email protected] | a9cea754 | 2009-05-20 04:30:23 | [diff] [blame] | 245 | |
[email protected] | 326e679 | 2009-12-11 21:04:42 | [diff] [blame] | 246 | return transport_security_state_.get(); |
[email protected] | a9cea754 | 2009-05-20 04:30:23 | [diff] [blame] | 247 | } |
| 248 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 249 | virtual HistoryService* GetHistoryService(ServiceAccessType sat) { |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 250 | if (sat == EXPLICIT_ACCESS) |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 251 | return profile_->GetHistoryService(sat); |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 252 | |
| 253 | NOTREACHED() << "This profile is OffTheRecord"; |
| 254 | return NULL; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 255 | } |
| 256 | |
[email protected] | 0850fa6 | 2009-10-08 22:34:29 | [diff] [blame] | 257 | virtual HistoryService* GetHistoryServiceWithoutCreating() { |
| 258 | return profile_->GetHistoryServiceWithoutCreating(); |
| 259 | } |
| 260 | |
[email protected] | 0189bc72 | 2009-08-28 21:56:48 | [diff] [blame] | 261 | virtual FaviconService* GetFaviconService(ServiceAccessType sat) { |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 262 | if (sat == EXPLICIT_ACCESS) |
[email protected] | 0189bc72 | 2009-08-28 21:56:48 | [diff] [blame] | 263 | return profile_->GetFaviconService(sat); |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 264 | |
| 265 | NOTREACHED() << "This profile is OffTheRecord"; |
| 266 | return NULL; |
[email protected] | 0189bc72 | 2009-08-28 21:56:48 | [diff] [blame] | 267 | } |
| 268 | |
[email protected] | 69c579e | 2010-04-23 20:01:00 | [diff] [blame] | 269 | virtual AutocompleteClassifier* GetAutocompleteClassifier() { |
| 270 | return profile_->GetAutocompleteClassifier(); |
[email protected] | 90085af0 | 2009-10-29 17:53:21 | [diff] [blame] | 271 | } |
| 272 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 273 | virtual WebDataService* GetWebDataService(ServiceAccessType sat) { |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 274 | if (sat == EXPLICIT_ACCESS) |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 275 | return profile_->GetWebDataService(sat); |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 276 | |
| 277 | NOTREACHED() << "This profile is OffTheRecord"; |
| 278 | return NULL; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 279 | } |
| 280 | |
[email protected] | 9cddbe37 | 2009-10-23 21:23:53 | [diff] [blame] | 281 | virtual WebDataService* GetWebDataServiceWithoutCreating() { |
| 282 | return profile_->GetWebDataServiceWithoutCreating(); |
| 283 | } |
| 284 | |
[email protected] | e69d3395 | 2009-06-03 22:00:41 | [diff] [blame] | 285 | virtual PasswordStore* GetPasswordStore(ServiceAccessType sat) { |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 286 | if (sat == EXPLICIT_ACCESS) |
[email protected] | e69d3395 | 2009-06-03 22:00:41 | [diff] [blame] | 287 | return profile_->GetPasswordStore(sat); |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 288 | |
| 289 | NOTREACHED() << "This profile is OffTheRecord"; |
| 290 | return NULL; |
[email protected] | e69d3395 | 2009-06-03 22:00:41 | [diff] [blame] | 291 | } |
| 292 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 293 | virtual PrefService* GetPrefs() { |
| 294 | return profile_->GetPrefs(); |
| 295 | } |
| 296 | |
| 297 | virtual TemplateURLModel* GetTemplateURLModel() { |
| 298 | return profile_->GetTemplateURLModel(); |
| 299 | } |
| 300 | |
| 301 | virtual TemplateURLFetcher* GetTemplateURLFetcher() { |
| 302 | return profile_->GetTemplateURLFetcher(); |
| 303 | } |
| 304 | |
| 305 | virtual DownloadManager* GetDownloadManager() { |
| 306 | if (!download_manager_.get()) { |
[email protected] | 073ed7b | 2010-09-27 09:20:02 | [diff] [blame] | 307 | scoped_refptr<DownloadManager> dlm( |
| 308 | new DownloadManager(g_browser_process->download_status_updater())); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 309 | dlm->Init(this); |
| 310 | download_manager_.swap(dlm); |
| 311 | } |
| 312 | return download_manager_.get(); |
| 313 | } |
| 314 | |
| 315 | virtual bool HasCreatedDownloadManager() const { |
| 316 | return (download_manager_.get() != NULL); |
| 317 | } |
| 318 | |
[email protected] | def1171 | 2009-11-06 00:42:15 | [diff] [blame] | 319 | virtual PersonalDataManager* GetPersonalDataManager() { |
| 320 | return NULL; |
| 321 | } |
| 322 | |
[email protected] | c44b790 | 2010-08-27 21:24:43 | [diff] [blame] | 323 | virtual FileSystemHostContext* GetFileSystemHostContext() { |
| 324 | if (!file_system_host_context_) |
| 325 | file_system_host_context_ = new FileSystemHostContext( |
| 326 | GetPath(), IsOffTheRecord()); |
| 327 | DCHECK(file_system_host_context_.get()); |
| 328 | return file_system_host_context_.get(); |
| 329 | } |
| 330 | |
[email protected] | 4a19063 | 2009-05-09 01:07:42 | [diff] [blame] | 331 | virtual void InitThemes() { |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 332 | profile_->InitThemes(); |
[email protected] | 4a19063 | 2009-05-09 01:07:42 | [diff] [blame] | 333 | } |
| 334 | |
| 335 | virtual void SetTheme(Extension* extension) { |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 336 | profile_->SetTheme(extension); |
[email protected] | 4a19063 | 2009-05-09 01:07:42 | [diff] [blame] | 337 | } |
| 338 | |
[email protected] | a5166af6 | 2009-07-03 00:42:29 | [diff] [blame] | 339 | virtual void SetNativeTheme() { |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 340 | profile_->SetNativeTheme(); |
[email protected] | a5166af6 | 2009-07-03 00:42:29 | [diff] [blame] | 341 | } |
| 342 | |
[email protected] | 4a19063 | 2009-05-09 01:07:42 | [diff] [blame] | 343 | virtual void ClearTheme() { |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 344 | profile_->ClearTheme(); |
[email protected] | 4a19063 | 2009-05-09 01:07:42 | [diff] [blame] | 345 | } |
| 346 | |
[email protected] | 51c490b | 2009-08-03 16:34:34 | [diff] [blame] | 347 | virtual Extension* GetTheme() { |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 348 | return profile_->GetTheme(); |
[email protected] | 51c490b | 2009-08-03 16:34:34 | [diff] [blame] | 349 | } |
| 350 | |
[email protected] | 5786d3d | 2009-12-18 00:18:44 | [diff] [blame] | 351 | virtual BrowserThemeProvider* GetThemeProvider() { |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 352 | return profile_->GetThemeProvider(); |
[email protected] | 4a19063 | 2009-05-09 01:07:42 | [diff] [blame] | 353 | } |
| 354 | |
[email protected] | be180c80 | 2009-10-23 06:33:31 | [diff] [blame] | 355 | virtual URLRequestContextGetter* GetRequestContext() { |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 356 | return request_context_; |
| 357 | } |
| 358 | |
[email protected] | be180c80 | 2009-10-23 06:33:31 | [diff] [blame] | 359 | virtual URLRequestContextGetter* GetRequestContextForMedia() { |
[email protected] | d14c7ac | 2009-05-29 20:38:11 | [diff] [blame] | 360 | // In OTR mode, media request context is the same as the original one. |
| 361 | return request_context_; |
[email protected] | e7f2964 | 2009-03-02 22:53:18 | [diff] [blame] | 362 | } |
| 363 | |
[email protected] | be180c80 | 2009-10-23 06:33:31 | [diff] [blame] | 364 | URLRequestContextGetter* GetRequestContextForExtensions() { |
[email protected] | bc535ee5 | 2010-08-31 18:40:32 | [diff] [blame] | 365 | if (!extensions_request_context_) { |
| 366 | extensions_request_context_ = |
| 367 | ChromeURLRequestContextGetter::CreateOffTheRecordForExtensions(this); |
| 368 | } |
| 369 | |
| 370 | return extensions_request_context_; |
[email protected] | 47accfd6 | 2009-05-14 18:46:21 | [diff] [blame] | 371 | } |
| 372 | |
[email protected] | db36938c | 2009-08-19 21:48:42 | [diff] [blame] | 373 | virtual net::SSLConfigService* GetSSLConfigService() { |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 374 | return profile_->GetSSLConfigService(); |
[email protected] | db36938c | 2009-08-19 21:48:42 | [diff] [blame] | 375 | } |
| 376 | |
[email protected] | e284e6d8 | 2010-01-29 19:49:45 | [diff] [blame] | 377 | virtual HostContentSettingsMap* GetHostContentSettingsMap() { |
[email protected] | bd14784 | 2010-04-09 15:29:17 | [diff] [blame] | 378 | // Retrieve the host content settings map of the parent profile in order to |
| 379 | // ensure the preferences have been migrated. |
| 380 | profile_->GetHostContentSettingsMap(); |
| 381 | if (!host_content_settings_map_.get()) |
| 382 | host_content_settings_map_ = new HostContentSettingsMap(this); |
| 383 | return host_content_settings_map_.get(); |
[email protected] | e284e6d8 | 2010-01-29 19:49:45 | [diff] [blame] | 384 | } |
| 385 | |
[email protected] | 40bd658 | 2009-12-04 23:49:51 | [diff] [blame] | 386 | virtual HostZoomMap* GetHostZoomMap() { |
[email protected] | c18d4f48 | 2010-05-18 21:19:50 | [diff] [blame] | 387 | if (!host_zoom_map_) |
| 388 | host_zoom_map_ = new HostZoomMap(this); |
| 389 | return host_zoom_map_.get(); |
[email protected] | 40bd658 | 2009-12-04 23:49:51 | [diff] [blame] | 390 | } |
| 391 | |
[email protected] | aee541e | 2010-03-19 01:52:45 | [diff] [blame] | 392 | virtual GeolocationContentSettingsMap* GetGeolocationContentSettingsMap() { |
| 393 | return profile_->GetGeolocationContentSettingsMap(); |
| 394 | } |
| 395 | |
[email protected] | 8b4b84ee | 2010-05-11 13:08:52 | [diff] [blame] | 396 | virtual GeolocationPermissionContext* GetGeolocationPermissionContext() { |
| 397 | return profile_->GetGeolocationPermissionContext(); |
| 398 | } |
| 399 | |
[email protected] | 6c32ce7 | 2010-03-08 05:18:06 | [diff] [blame] | 400 | virtual UserStyleSheetWatcher* GetUserStyleSheetWatcher() { |
| 401 | return profile_->GetUserStyleSheetWatcher(); |
| 402 | } |
| 403 | |
[email protected] | e5d2f713 | 2010-04-09 18:13:53 | [diff] [blame] | 404 | virtual FindBarState* GetFindBarState() { |
| 405 | if (!find_bar_state_.get()) |
| 406 | find_bar_state_.reset(new FindBarState()); |
| 407 | return find_bar_state_.get(); |
| 408 | } |
| 409 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 410 | virtual SessionService* GetSessionService() { |
| 411 | // Don't save any sessions when off the record. |
| 412 | return NULL; |
| 413 | } |
| 414 | |
| 415 | virtual void ShutdownSessionService() { |
| 416 | // We don't allow a session service, nothing to do. |
| 417 | } |
| 418 | |
| 419 | virtual bool HasSessionService() const { |
| 420 | // We never have a session service. |
| 421 | return false; |
| 422 | } |
| 423 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 424 | virtual bool DidLastSessionExitCleanly() { |
| 425 | return profile_->DidLastSessionExitCleanly(); |
| 426 | } |
| 427 | |
[email protected] | d8e41ed | 2008-09-11 15:22:32 | [diff] [blame] | 428 | virtual BookmarkModel* GetBookmarkModel() { |
| 429 | return profile_->GetBookmarkModel(); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 430 | } |
| 431 | |
[email protected] | 4bb33630 | 2009-10-12 05:44:26 | [diff] [blame] | 432 | virtual DesktopNotificationService* GetDesktopNotificationService() { |
[email protected] | 7d7696c5 | 2009-12-01 20:54:58 | [diff] [blame] | 433 | if (!desktop_notification_service_.get()) { |
| 434 | desktop_notification_service_.reset(new DesktopNotificationService( |
| 435 | this, g_browser_process->notification_ui_manager())); |
| 436 | } |
| 437 | return desktop_notification_service_.get(); |
[email protected] | 4bb33630 | 2009-10-12 05:44:26 | [diff] [blame] | 438 | } |
| 439 | |
[email protected] | 8e4c2961 | 2010-07-14 01:24:45 | [diff] [blame] | 440 | virtual TokenService* GetTokenService() { |
| 441 | return NULL; |
| 442 | } |
| 443 | |
[email protected] | 48352c1 | 2009-08-15 01:19:11 | [diff] [blame] | 444 | virtual ProfileSyncService* GetProfileSyncService() { |
| 445 | return NULL; |
[email protected] | 3a453fa | 2008-08-15 18:46:34 | [diff] [blame] | 446 | } |
[email protected] | 3a453fa | 2008-08-15 18:46:34 | [diff] [blame] | 447 | |
[email protected] | e8234d3 | 2010-09-09 20:36:39 | [diff] [blame] | 448 | virtual ProfileSyncService* GetProfileSyncService( |
| 449 | const std::string& cros_user) { |
| 450 | return NULL; |
| 451 | } |
| 452 | |
[email protected] | 1bd056e | 2010-04-20 02:03:48 | [diff] [blame] | 453 | virtual CloudPrintProxyService* GetCloudPrintProxyService() { |
| 454 | return NULL; |
| 455 | } |
| 456 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 457 | virtual bool IsSameProfile(Profile* profile) { |
[email protected] | 7a125184 | 2010-01-30 01:17:54 | [diff] [blame] | 458 | return (profile == this) || (profile == profile_); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 459 | } |
| 460 | |
| 461 | virtual Time GetStartTime() const { |
| 462 | return start_time_; |
| 463 | } |
| 464 | |
| 465 | virtual TabRestoreService* GetTabRestoreService() { |
| 466 | return NULL; |
| 467 | } |
| 468 | |
[email protected] | e7244d8 | 2008-10-29 18:13:26 | [diff] [blame] | 469 | virtual void ResetTabRestoreService() { |
[email protected] | 2093085 | 2008-10-15 19:30:41 | [diff] [blame] | 470 | } |
| 471 | |
[email protected] | 85c55dc | 2009-11-06 03:05:46 | [diff] [blame] | 472 | virtual SpellCheckHost* GetSpellCheckHost() { |
| 473 | return profile_->GetSpellCheckHost(); |
| 474 | } |
| 475 | |
| 476 | virtual void ReinitializeSpellCheckHost(bool force) { |
| 477 | profile_->ReinitializeSpellCheckHost(force); |
| 478 | } |
[email protected] | 85c55dc | 2009-11-06 03:05:46 | [diff] [blame] | 479 | |
[email protected] | 3bf335a | 2009-06-26 20:46:06 | [diff] [blame] | 480 | virtual WebKitContext* GetWebKitContext() { |
[email protected] | c27324b | 2009-11-19 22:44:29 | [diff] [blame] | 481 | if (!webkit_context_.get()) |
[email protected] | 70c19a93 | 2010-05-14 12:59:11 | [diff] [blame] | 482 | webkit_context_ = new WebKitContext(this); |
[email protected] | c27324b | 2009-11-19 22:44:29 | [diff] [blame] | 483 | DCHECK(webkit_context_.get()); |
| 484 | return webkit_context_.get(); |
| 485 | } |
[email protected] | 3bf335a | 2009-06-26 20:46:06 | [diff] [blame] | 486 | |
[email protected] | 523623c | 2010-05-19 16:03:42 | [diff] [blame] | 487 | virtual history::TopSites* GetTopSites() { |
| 488 | return NULL; |
| 489 | } |
| 490 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 491 | virtual void MarkAsCleanShutdown() { |
| 492 | } |
| 493 | |
[email protected] | bdbc87c | 2009-01-25 05:08:54 | [diff] [blame] | 494 | virtual void InitExtensions() { |
| 495 | NOTREACHED(); |
| 496 | } |
| 497 | |
[email protected] | 0ef69c7 | 2010-09-21 01:00:34 | [diff] [blame] | 498 | virtual void InitWebResources() { |
| 499 | NOTREACHED(); |
| 500 | } |
| 501 | |
[email protected] | 9c8dd90 | 2009-11-19 17:50:42 | [diff] [blame] | 502 | virtual NTPResourceCache* GetNTPResourceCache() { |
| 503 | // Just return the real profile resource cache. |
| 504 | return profile_->GetNTPResourceCache(); |
| 505 | } |
| 506 | |
[email protected] | 35896a3 | 2010-06-09 08:42:51 | [diff] [blame] | 507 | virtual FilePath last_selected_directory() { |
| 508 | const FilePath& directory = last_selected_directory_; |
| 509 | if (directory.empty()) { |
| 510 | return profile_->last_selected_directory(); |
| 511 | } |
| 512 | return directory; |
| 513 | } |
| 514 | |
| 515 | virtual void set_last_selected_directory(const FilePath& path) { |
| 516 | last_selected_directory_ = path; |
| 517 | } |
| 518 | |
[email protected] | f50278cd | 2010-08-24 17:34:08 | [diff] [blame] | 519 | #if defined(OS_CHROMEOS) |
| 520 | virtual chromeos::ProxyConfigServiceImpl* |
| 521 | GetChromeOSProxyConfigServiceImpl() { |
| 522 | return profile_->GetChromeOSProxyConfigServiceImpl(); |
| 523 | } |
| 524 | #endif // defined(OS_CHROMEOS) |
| 525 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 526 | virtual void ExitedOffTheRecordMode() { |
[email protected] | 326a6a9 | 2010-09-10 20:21:13 | [diff] [blame] | 527 | // DownloadManager is lazily created, so check before accessing it. |
| 528 | if (download_manager_.get()) { |
| 529 | // Drop our download manager so we forget about all the downloads made |
| 530 | // in off-the-record mode. |
| 531 | download_manager_->Shutdown(); |
| 532 | download_manager_ = NULL; |
| 533 | } |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 534 | } |
| 535 | |
| 536 | virtual void Observe(NotificationType type, |
| 537 | const NotificationSource& source, |
| 538 | const NotificationDetails& details) { |
[email protected] | bfd04a6 | 2009-02-01 18:16:56 | [diff] [blame] | 539 | DCHECK_EQ(NotificationType::BROWSER_CLOSED, type.value); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 540 | // We are only interested in OTR browser closing. |
| 541 | if (Source<Browser>(source)->profile() != this) |
| 542 | return; |
| 543 | |
| 544 | // Let's check if we still have an Off The Record window opened. |
| 545 | // Note that we check against 1 as this notification is sent before the |
| 546 | // browser window is actually removed from the list. |
| 547 | if (BrowserList::GetBrowserCount(this) <= 1) |
| 548 | ExitedOffTheRecordMode(); |
| 549 | } |
| 550 | |
[email protected] | 22339b1 | 2010-08-27 18:29:24 | [diff] [blame] | 551 | virtual ChromeBlobStorageContext* GetBlobStorageContext() { |
| 552 | if (!blob_storage_context_) { |
| 553 | blob_storage_context_ = new ChromeBlobStorageContext(); |
| 554 | ChromeThread::PostTask( |
| 555 | ChromeThread::IO, FROM_HERE, |
| 556 | NewRunnableMethod( |
| 557 | blob_storage_context_.get(), |
| 558 | &ChromeBlobStorageContext::InitializeOnIOThread)); |
| 559 | } |
| 560 | return blob_storage_context_; |
| 561 | } |
| 562 | |
[email protected] | 4361c7c | 2010-09-30 21:57:53 | [diff] [blame] | 563 | virtual ExtensionInfoMap* GetExtensionInfoMap() { |
| 564 | return profile_->GetExtensionInfoMap(); |
| 565 | } |
| 566 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 567 | private: |
[email protected] | 88cf329 | 2009-05-22 01:48:43 | [diff] [blame] | 568 | NotificationRegistrar registrar_; |
| 569 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 570 | // The real underlying profile. |
| 571 | Profile* profile_; |
| 572 | |
[email protected] | bc535ee5 | 2010-08-31 18:40:32 | [diff] [blame] | 573 | scoped_ptr<ExtensionProcessManager> extension_process_manager_; |
| 574 | |
[email protected] | 6ab9b20 | 2008-12-23 22:34:50 | [diff] [blame] | 575 | // The context to use for requests made from this OTR session. |
[email protected] | 13c3092 | 2009-11-19 03:43:19 | [diff] [blame] | 576 | scoped_refptr<ChromeURLRequestContextGetter> request_context_; |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 577 | |
[email protected] | bc535ee5 | 2010-08-31 18:40:32 | [diff] [blame] | 578 | // The context to use for requests made by an extension while in OTR mode. |
| 579 | scoped_refptr<ChromeURLRequestContextGetter> extensions_request_context_; |
| 580 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 581 | // The download manager that only stores downloaded items in memory. |
| 582 | scoped_refptr<DownloadManager> download_manager_; |
| 583 | |
[email protected] | 7d7696c5 | 2009-12-01 20:54:58 | [diff] [blame] | 584 | // Use a separate desktop notification service for OTR. |
| 585 | scoped_ptr<DesktopNotificationService> desktop_notification_service_; |
| 586 | |
[email protected] | bd14784 | 2010-04-09 15:29:17 | [diff] [blame] | 587 | // We use a non-writable content settings map for OTR. |
| 588 | scoped_refptr<HostContentSettingsMap> host_content_settings_map_; |
| 589 | |
[email protected] | c18d4f48 | 2010-05-18 21:19:50 | [diff] [blame] | 590 | // Use a separate zoom map for OTR. |
| 591 | scoped_refptr<HostZoomMap> host_zoom_map_; |
| 592 | |
[email protected] | 3bf335a | 2009-06-26 20:46:06 | [diff] [blame] | 593 | // Use a special WebKit context for OTR browsing. |
| 594 | scoped_refptr<WebKitContext> webkit_context_; |
| 595 | |
[email protected] | 34cc84f | 2009-02-13 10:04:35 | [diff] [blame] | 596 | // We don't want SSLHostState from the OTR profile to leak back to the main |
| 597 | // profile because then the main profile would learn some of the host names |
| 598 | // the user visited while OTR. |
| 599 | scoped_ptr<SSLHostState> ssl_host_state_; |
| 600 | |
[email protected] | e5d2f713 | 2010-04-09 18:13:53 | [diff] [blame] | 601 | // Use a separate FindBarState so search terms do not leak back to the main |
| 602 | // profile. |
| 603 | scoped_ptr<FindBarState> find_bar_state_; |
| 604 | |
[email protected] | 326e679 | 2009-12-11 21:04:42 | [diff] [blame] | 605 | // The TransportSecurityState that only stores enabled sites in memory. |
| 606 | scoped_refptr<net::TransportSecurityState> |
| 607 | transport_security_state_; |
[email protected] | a9cea754 | 2009-05-20 04:30:23 | [diff] [blame] | 608 | |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 609 | // Time we were started. |
| 610 | Time start_time_; |
| 611 | |
[email protected] | 02a5cdb | 2010-08-11 20:47:32 | [diff] [blame] | 612 | scoped_refptr<ChromeAppCacheService> appcache_service_; |
| 613 | |
[email protected] | 2f351cb | 2009-11-09 23:43:34 | [diff] [blame] | 614 | // The main database tracker for this profile. |
| 615 | // Should be used only on the file thread. |
| 616 | scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; |
| 617 | |
[email protected] | 35896a3 | 2010-06-09 08:42:51 | [diff] [blame] | 618 | FilePath last_selected_directory_; |
| 619 | |
[email protected] | 398206c | 2010-06-21 01:46:08 | [diff] [blame] | 620 | // Tracks all BackgroundContents running under this profile. |
| 621 | scoped_ptr<BackgroundContentsService> background_contents_service_; |
| 622 | |
[email protected] | 22339b1 | 2010-08-27 18:29:24 | [diff] [blame] | 623 | scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; |
| 624 | |
[email protected] | c44b790 | 2010-08-27 21:24:43 | [diff] [blame] | 625 | // The file_system context for this profile. |
| 626 | scoped_refptr<FileSystemHostContext> file_system_host_context_; |
| 627 | |
[email protected] | 90085af0 | 2009-10-29 17:53:21 | [diff] [blame] | 628 | DISALLOW_COPY_AND_ASSIGN(OffTheRecordProfileImpl); |
initial.commit | 09911bf | 2008-07-26 23:55:29 | [diff] [blame] | 629 | }; |
| 630 | |
[email protected] | 5a0b42e | 2010-07-30 23:42:59 | [diff] [blame] | 631 | Profile *Profile::CreateOffTheRecordProfile() { |
| 632 | return new OffTheRecordProfileImpl(this); |
[email protected] | 48352c1 | 2009-08-15 01:19:11 | [diff] [blame] | 633 | } |