Chromium Code Reviews| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 135 chromeos::switches::kGuestSession); | 135 chromeos::switches::kGuestSession); |
| 136 return is_guest_session; | 136 return is_guest_session; |
| 137 #else | 137 #else |
| 138 return false; | 138 return false; |
| 139 #endif | 139 #endif |
| 140 } | 140 } |
| 141 | 141 |
| 142 bool Profile::IsNewProfile() { | 142 bool Profile::IsNewProfile() { |
| 143 // The profile has been shut down if the prefs were loaded from disk, unless | 143 // The profile has been shut down if the prefs were loaded from disk, unless |
| 144 // first-run autoimport wrote them and reloaded the pref service. | 144 // first-run autoimport wrote them and reloaded the pref service. |
| 145 // TODO(dconnelly): revisit this when crbug.com/22142 (unifying the profile | 145 // TODO(dconnelly): revisit this when crbug.com/22142 (unifying the profile |
|
gab
2013/04/18 21:51:18
@dconnelly: FYI :)
dconnelly
2013/04/22 08:18:56
Cool! There's a browser test in chrome/browser/ui/
| |
| 146 // import code) is fixed. | 146 // import code) is fixed. |
| 147 return GetOriginalProfile()->GetPrefs()->GetInitializationStatus() == | 147 return GetOriginalProfile()->GetPrefs()->GetInitializationStatus() == |
| 148 PrefService::INITIALIZATION_STATUS_CREATED_NEW_PREF_STORE || | 148 PrefService::INITIALIZATION_STATUS_CREATED_NEW_PREF_STORE; |
| 149 first_run::DidPerformProfileImport(NULL); | |
| 150 } | 149 } |
| 151 | 150 |
| 152 bool Profile::IsSyncAccessible() { | 151 bool Profile::IsSyncAccessible() { |
| 153 browser_sync::SyncPrefs prefs(GetPrefs()); | 152 browser_sync::SyncPrefs prefs(GetPrefs()); |
| 154 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); | 153 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); |
| 155 } | 154 } |
| 156 | 155 |
| 157 void Profile::MaybeSendDestroyedNotification() { | 156 void Profile::MaybeSendDestroyedNotification() { |
| 158 if (!sent_destroyed_notification_) { | 157 if (!sent_destroyed_notification_) { |
| 159 sent_destroyed_notification_ = true; | 158 sent_destroyed_notification_ = true; |
| 160 content::NotificationService::current()->Notify( | 159 content::NotificationService::current()->Notify( |
| 161 chrome::NOTIFICATION_PROFILE_DESTROYED, | 160 chrome::NOTIFICATION_PROFILE_DESTROYED, |
| 162 content::Source<Profile>(this), | 161 content::Source<Profile>(this), |
| 163 content::NotificationService::NoDetails()); | 162 content::NotificationService::NoDetails()); |
| 164 } | 163 } |
| 165 } | 164 } |
| OLD | NEW |