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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 sync_driver::SyncPrefs prefs(GetPrefs()); |
217 return ProfileSyncService::IsSyncAllowedByFlag() && !prefs.IsManaged(); | 217 return browser_sync::ProfileSyncService::IsSyncAllowedByFlag() && |
| 218 !prefs.IsManaged(); |
218 } | 219 } |
219 | 220 |
220 void Profile::MaybeSendDestroyedNotification() { | 221 void Profile::MaybeSendDestroyedNotification() { |
221 if (!sent_destroyed_notification_) { | 222 if (!sent_destroyed_notification_) { |
222 sent_destroyed_notification_ = true; | 223 sent_destroyed_notification_ = true; |
223 | 224 |
224 NotifyWillBeDestroyed(this); | 225 NotifyWillBeDestroyed(this); |
225 content::NotificationService::current()->Notify( | 226 content::NotificationService::current()->Notify( |
226 chrome::NOTIFICATION_PROFILE_DESTROYED, | 227 chrome::NOTIFICATION_PROFILE_DESTROYED, |
227 content::Source<Profile>(this), | 228 content::Source<Profile>(this), |
228 content::NotificationService::NoDetails()); | 229 content::NotificationService::NoDetails()); |
229 } | 230 } |
230 } | 231 } |
231 | 232 |
232 bool ProfileCompare::operator()(Profile* a, Profile* b) const { | 233 bool ProfileCompare::operator()(Profile* a, Profile* b) const { |
233 DCHECK(a && b); | 234 DCHECK(a && b); |
234 if (a->IsSameProfile(b)) | 235 if (a->IsSameProfile(b)) |
235 return false; | 236 return false; |
236 return a->GetOriginalProfile() < b->GetOriginalProfile(); | 237 return a->GetOriginalProfile() < b->GetOriginalProfile(); |
237 } | 238 } |
238 | 239 |
239 double Profile::GetDefaultZoomLevelForProfile() { | 240 double Profile::GetDefaultZoomLevelForProfile() { |
240 return GetDefaultStoragePartition(this) | 241 return GetDefaultStoragePartition(this) |
241 ->GetHostZoomMap() | 242 ->GetHostZoomMap() |
242 ->GetDefaultZoomLevel(); | 243 ->GetDefaultZoomLevel(); |
243 } | 244 } |
OLD | NEW |