| 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.h" | 5 #include "chrome/browser/profiles/profile.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 | 245 |
| 246 // No ProfileSyncService created yet - we don't want to create one, so just | 246 // No ProfileSyncService created yet - we don't want to create one, so just |
| 247 // infer the accessible state by looking at prefs/command line flags. | 247 // infer the accessible state by looking at prefs/command line flags. |
| 248 sync_driver::SyncPrefs prefs(GetPrefs()); | 248 sync_driver::SyncPrefs prefs(GetPrefs()); |
| 249 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); | 249 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 void Profile::MaybeSendDestroyedNotification() { | 252 void Profile::MaybeSendDestroyedNotification() { |
| 253 if (!sent_destroyed_notification_) { | 253 if (!sent_destroyed_notification_) { |
| 254 sent_destroyed_notification_ = true; | 254 sent_destroyed_notification_ = true; |
| 255 |
| 256 NotifyWillBeDestroyed(this); |
| 255 content::NotificationService::current()->Notify( | 257 content::NotificationService::current()->Notify( |
| 256 chrome::NOTIFICATION_PROFILE_DESTROYED, | 258 chrome::NOTIFICATION_PROFILE_DESTROYED, |
| 257 content::Source<Profile>(this), | 259 content::Source<Profile>(this), |
| 258 content::NotificationService::NoDetails()); | 260 content::NotificationService::NoDetails()); |
| 259 } | 261 } |
| 260 } | 262 } |
| 261 | 263 |
| 262 bool ProfileCompare::operator()(Profile* a, Profile* b) const { | 264 bool ProfileCompare::operator()(Profile* a, Profile* b) const { |
| 263 DCHECK(a && b); | 265 DCHECK(a && b); |
| 264 if (a->IsSameProfile(b)) | 266 if (a->IsSameProfile(b)) |
| 265 return false; | 267 return false; |
| 266 return a->GetOriginalProfile() < b->GetOriginalProfile(); | 268 return a->GetOriginalProfile() < b->GetOriginalProfile(); |
| 267 } | 269 } |
| OLD | NEW |