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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 #if defined(OS_CHROMEOS) | 179 #if defined(OS_CHROMEOS) |
180 GetRequestContext(); | 180 GetRequestContext(); |
181 #endif // defined(OS_CHROMEOS) | 181 #endif // defined(OS_CHROMEOS) |
182 | 182 |
183 // Make the chrome//extension-icon/ resource available. | 183 // Make the chrome//extension-icon/ resource available. |
184 ExtensionIconSource* icon_source = new ExtensionIconSource(real_profile); | 184 ExtensionIconSource* icon_source = new ExtensionIconSource(real_profile); |
185 GetChromeURLDataManager()->AddDataSource(icon_source); | 185 GetChromeURLDataManager()->AddDataSource(icon_source); |
186 } | 186 } |
187 | 187 |
188 virtual ~OffTheRecordProfileImpl() { | 188 virtual ~OffTheRecordProfileImpl() { |
| 189 // Notify observers that this profile is going to be destroyed soon before |
| 190 // shutting down other members that may hold references to it. |
189 NotificationService::current()->Notify(NotificationType::PROFILE_DESTROYED, | 191 NotificationService::current()->Notify(NotificationType::PROFILE_DESTROYED, |
190 Source<Profile>(this), | 192 Source<Profile>(this), |
191 NotificationService::NoDetails()); | 193 NotificationService::NoDetails()); |
192 | 194 |
193 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); | 195 ProfileDependencyManager::GetInstance()->DestroyProfileServices(this); |
194 | 196 |
195 // Clean up all DB files/directories | 197 // Clean up all DB files/directories |
196 if (db_tracker_) | 198 if (db_tracker_) |
197 BrowserThread::PostTask( | 199 BrowserThread::PostTask( |
198 BrowserThread::FILE, FROM_HERE, | 200 BrowserThread::FILE, FROM_HERE, |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
780 }; | 782 }; |
781 #endif | 783 #endif |
782 | 784 |
783 Profile* Profile::CreateOffTheRecordProfile() { | 785 Profile* Profile::CreateOffTheRecordProfile() { |
784 #if defined(OS_CHROMEOS) | 786 #if defined(OS_CHROMEOS) |
785 if (Profile::IsGuestSession()) | 787 if (Profile::IsGuestSession()) |
786 return new GuestSessionProfile(this); | 788 return new GuestSessionProfile(this); |
787 #endif | 789 #endif |
788 return new OffTheRecordProfileImpl(this); | 790 return new OffTheRecordProfileImpl(this); |
789 } | 791 } |
OLD | NEW |