| 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 "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 PrefService::INITIALIZATION_STATUS_CREATED_NEW_PREF_STORE; | 206 PrefService::INITIALIZATION_STATUS_CREATED_NEW_PREF_STORE; |
| 207 } | 207 } |
| 208 | 208 |
| 209 bool Profile::IsSyncAllowed() { | 209 bool Profile::IsSyncAllowed() { |
| 210 if (ProfileSyncServiceFactory::HasProfileSyncService(this)) { | 210 if (ProfileSyncServiceFactory::HasProfileSyncService(this)) { |
| 211 return ProfileSyncServiceFactory::GetForProfile(this)->IsSyncAllowed(); | 211 return ProfileSyncServiceFactory::GetForProfile(this)->IsSyncAllowed(); |
| 212 } | 212 } |
| 213 | 213 |
| 214 // No ProfileSyncService created yet - we don't want to create one, so just | 214 // No ProfileSyncService created yet - we don't want to create one, so just |
| 215 // infer the accessible state by looking at prefs/command line flags. | 215 // infer the accessible state by looking at prefs/command line flags. |
| 216 sync_driver::SyncPrefs prefs(GetPrefs()); | 216 syncer::SyncPrefs prefs(GetPrefs()); |
| 217 return browser_sync::ProfileSyncService::IsSyncAllowedByFlag() && | 217 return browser_sync::ProfileSyncService::IsSyncAllowedByFlag() && |
| 218 !prefs.IsManaged(); | 218 !prefs.IsManaged(); |
| 219 } | 219 } |
| 220 | 220 |
| 221 void Profile::MaybeSendDestroyedNotification() { | 221 void Profile::MaybeSendDestroyedNotification() { |
| 222 if (!sent_destroyed_notification_) { | 222 if (!sent_destroyed_notification_) { |
| 223 sent_destroyed_notification_ = true; | 223 sent_destroyed_notification_ = true; |
| 224 | 224 |
| 225 NotifyWillBeDestroyed(this); | 225 NotifyWillBeDestroyed(this); |
| 226 content::NotificationService::current()->Notify( | 226 content::NotificationService::current()->Notify( |
| 227 chrome::NOTIFICATION_PROFILE_DESTROYED, | 227 chrome::NOTIFICATION_PROFILE_DESTROYED, |
| 228 content::Source<Profile>(this), | 228 content::Source<Profile>(this), |
| 229 content::NotificationService::NoDetails()); | 229 content::NotificationService::NoDetails()); |
| 230 } | 230 } |
| 231 } | 231 } |
| 232 | 232 |
| 233 bool ProfileCompare::operator()(Profile* a, Profile* b) const { | 233 bool ProfileCompare::operator()(Profile* a, Profile* b) const { |
| 234 DCHECK(a && b); | 234 DCHECK(a && b); |
| 235 if (a->IsSameProfile(b)) | 235 if (a->IsSameProfile(b)) |
| 236 return false; | 236 return false; |
| 237 return a->GetOriginalProfile() < b->GetOriginalProfile(); | 237 return a->GetOriginalProfile() < b->GetOriginalProfile(); |
| 238 } | 238 } |
| 239 | 239 |
| 240 double Profile::GetDefaultZoomLevelForProfile() { | 240 double Profile::GetDefaultZoomLevelForProfile() { |
| 241 return GetDefaultStoragePartition(this) | 241 return GetDefaultStoragePartition(this) |
| 242 ->GetHostZoomMap() | 242 ->GetHostZoomMap() |
| 243 ->GetDefaultZoomLevel(); | 243 ->GetDefaultZoomLevel(); |
| 244 } | 244 } |
| OLD | NEW |