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 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 return false; | 160 return false; |
161 #endif | 161 #endif |
162 } | 162 } |
163 | 163 |
164 bool Profile::IsNewProfile() { | 164 bool Profile::IsNewProfile() { |
165 // The profile has been shut down if the prefs were loaded from disk, unless | 165 // The profile has been shut down if the prefs were loaded from disk, unless |
166 // first-run autoimport wrote them and reloaded the pref service. | 166 // first-run autoimport wrote them and reloaded the pref service. |
167 // TODO(dconnelly): revisit this when crbug.com/22142 (unifying the profile | 167 // TODO(dconnelly): revisit this when crbug.com/22142 (unifying the profile |
168 // import code) is fixed. | 168 // import code) is fixed. |
169 return GetOriginalProfile()->GetPrefs()->GetInitializationStatus() == | 169 return GetOriginalProfile()->GetPrefs()->GetInitializationStatus() == |
170 PrefService::INITIALIZATION_STATUS_CREATED_NEW_PREF_STORE || | 170 PrefService::INITIALIZATION_STATUS_CREATED_NEW_PREF_STORE; |
171 first_run::DidPerformProfileImport(NULL); | |
172 } | 171 } |
173 | 172 |
174 bool Profile::IsSyncAccessible() { | 173 bool Profile::IsSyncAccessible() { |
175 browser_sync::SyncPrefs prefs(GetPrefs()); | 174 browser_sync::SyncPrefs prefs(GetPrefs()); |
176 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); | 175 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); |
177 } | 176 } |
178 | 177 |
179 void Profile::MaybeSendDestroyedNotification() { | 178 void Profile::MaybeSendDestroyedNotification() { |
180 if (!sent_destroyed_notification_) { | 179 if (!sent_destroyed_notification_) { |
181 sent_destroyed_notification_ = true; | 180 sent_destroyed_notification_ = true; |
182 content::NotificationService::current()->Notify( | 181 content::NotificationService::current()->Notify( |
183 chrome::NOTIFICATION_PROFILE_DESTROYED, | 182 chrome::NOTIFICATION_PROFILE_DESTROYED, |
184 content::Source<Profile>(this), | 183 content::Source<Profile>(this), |
185 content::NotificationService::NoDetails()); | 184 content::NotificationService::NoDetails()); |
186 } | 185 } |
187 } | 186 } |
OLD | NEW |