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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 234 |
235 // No ProfileSyncService created yet - we don't want to create one, so just | 235 // No ProfileSyncService created yet - we don't want to create one, so just |
236 // infer the accessible state by looking at prefs/command line flags. | 236 // infer the accessible state by looking at prefs/command line flags. |
237 sync_driver::SyncPrefs prefs(GetPrefs()); | 237 sync_driver::SyncPrefs prefs(GetPrefs()); |
238 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); | 238 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); |
239 } | 239 } |
240 | 240 |
241 void Profile::MaybeSendDestroyedNotification() { | 241 void Profile::MaybeSendDestroyedNotification() { |
242 if (!sent_destroyed_notification_) { | 242 if (!sent_destroyed_notification_) { |
243 sent_destroyed_notification_ = true; | 243 sent_destroyed_notification_ = true; |
| 244 LOG(ERROR) << "JAMES send profile destroyed"; |
244 content::NotificationService::current()->Notify( | 245 content::NotificationService::current()->Notify( |
245 chrome::NOTIFICATION_PROFILE_DESTROYED, | 246 chrome::NOTIFICATION_PROFILE_DESTROYED, |
246 content::Source<Profile>(this), | 247 content::Source<Profile>(this), |
247 content::NotificationService::NoDetails()); | 248 content::NotificationService::NoDetails()); |
248 } | 249 } |
249 } | 250 } |
250 | 251 |
251 bool ProfileCompare::operator()(Profile* a, Profile* b) const { | 252 bool ProfileCompare::operator()(Profile* a, Profile* b) const { |
252 DCHECK(a && b); | 253 DCHECK(a && b); |
253 if (a->IsSameProfile(b)) | 254 if (a->IsSameProfile(b)) |
254 return false; | 255 return false; |
255 return a->GetOriginalProfile() < b->GetOriginalProfile(); | 256 return a->GetOriginalProfile() < b->GetOriginalProfile(); |
256 } | 257 } |
OLD | NEW |