| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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.h" | 5 #include "chrome/browser/profiles/profile.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" | 28 #include "chrome/browser/profiles/off_the_record_profile_io_data.h" |
| 29 #include "chrome/browser/profiles/profile_dependency_manager.h" | 29 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 30 #include "chrome/browser/sync/profile_sync_service.h" | 30 #include "chrome/browser/sync/profile_sync_service.h" |
| 31 #include "chrome/browser/themes/theme_service.h" | 31 #include "chrome/browser/themes/theme_service.h" |
| 32 #include "chrome/browser/transport_security_persister.h" | 32 #include "chrome/browser/transport_security_persister.h" |
| 33 #include "chrome/browser/ui/browser_list.h" | 33 #include "chrome/browser/ui/browser_list.h" |
| 34 #include "chrome/browser/ui/find_bar/find_bar_state.h" | 34 #include "chrome/browser/ui/find_bar/find_bar_state.h" |
| 35 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 35 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 36 #include "chrome/browser/ui/webui/extension_icon_source.h" | 36 #include "chrome/browser/ui/webui/extension_icon_source.h" |
| 37 #include "chrome/common/chrome_constants.h" | 37 #include "chrome/common/chrome_constants.h" |
| 38 #include "chrome/common/chrome_notification_types.h" |
| 38 #include "chrome/common/chrome_paths.h" | 39 #include "chrome/common/chrome_paths.h" |
| 39 #include "chrome/common/chrome_switches.h" | 40 #include "chrome/common/chrome_switches.h" |
| 40 #include "chrome/common/extensions/extension.h" | 41 #include "chrome/common/extensions/extension.h" |
| 41 #include "chrome/common/json_pref_store.h" | 42 #include "chrome/common/json_pref_store.h" |
| 42 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
| 43 #include "chrome/common/render_messages.h" | 44 #include "chrome/common/render_messages.h" |
| 44 #include "content/browser/appcache/chrome_appcache_service.h" | 45 #include "content/browser/appcache/chrome_appcache_service.h" |
| 45 #include "content/browser/browser_thread.h" | 46 #include "content/browser/browser_thread.h" |
| 46 #include "content/browser/chrome_blob_storage_context.h" | 47 #include "content/browser/chrome_blob_storage_context.h" |
| 47 #include "content/browser/file_system/browser_file_system_helper.h" | 48 #include "content/browser/file_system/browser_file_system_helper.h" |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 GetChromeURLDataManager()->AddDataSource(icon_source); | 246 GetChromeURLDataManager()->AddDataSource(icon_source); |
| 246 | 247 |
| 247 BrowserThread::PostTask( | 248 BrowserThread::PostTask( |
| 248 BrowserThread::IO, FROM_HERE, | 249 BrowserThread::IO, FROM_HERE, |
| 249 NewRunnableFunction( | 250 NewRunnableFunction( |
| 250 &NotifyOTRProfileCreatedOnIOThread, | 251 &NotifyOTRProfileCreatedOnIOThread, |
| 251 profile_->GetRuntimeId(), GetRuntimeId())); | 252 profile_->GetRuntimeId(), GetRuntimeId())); |
| 252 } | 253 } |
| 253 | 254 |
| 254 virtual ~OffTheRecordProfileImpl() { | 255 virtual ~OffTheRecordProfileImpl() { |
| 255 NotificationService::current()->Notify(NotificationType::PROFILE_DESTROYED, | 256 NotificationService::current()->Notify( |
| 256 Source<Profile>(this), | 257 chrome::NOTIFICATION_PROFILE_DESTROYED, Source<Profile>(this), |
| 257 NotificationService::NoDetails()); | 258 NotificationService::NoDetails()); |
| 258 | 259 |
| 259 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); | 260 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); |
| 260 | 261 |
| 261 BrowserThread::PostTask( | 262 BrowserThread::PostTask( |
| 262 BrowserThread::IO, FROM_HERE, | 263 BrowserThread::IO, FROM_HERE, |
| 263 NewRunnableFunction( | 264 NewRunnableFunction( |
| 264 &NotifyOTRProfileDestroyedOnIOThread, | 265 &NotifyOTRProfileDestroyedOnIOThread, |
| 265 profile_->GetRuntimeId(), GetRuntimeId())); | 266 profile_->GetRuntimeId(), GetRuntimeId())); |
| 266 | 267 |
| 267 // Clean up all DB files/directories | 268 // Clean up all DB files/directories |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 851 }; | 852 }; |
| 852 #endif | 853 #endif |
| 853 | 854 |
| 854 Profile* Profile::CreateOffTheRecordProfile() { | 855 Profile* Profile::CreateOffTheRecordProfile() { |
| 855 #if defined(OS_CHROMEOS) | 856 #if defined(OS_CHROMEOS) |
| 856 if (Profile::IsGuestSession()) | 857 if (Profile::IsGuestSession()) |
| 857 return new GuestSessionProfile(this); | 858 return new GuestSessionProfile(this); |
| 858 #endif | 859 #endif |
| 859 return new OffTheRecordProfileImpl(this); | 860 return new OffTheRecordProfileImpl(this); |
| 860 } | 861 } |
| OLD | NEW |