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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
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); | 149 first_run::DidPerformProfileImport(NULL); |
150 } | 150 } |
151 | 151 |
152 bool Profile::IsSyncAccessible() { | 152 bool Profile::IsSyncAccessible() { |
153 browser_sync::SyncPrefs prefs(GetPrefs()); | 153 browser_sync::SyncPrefs prefs(GetPrefs()); |
154 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); | 154 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged() && |
| 155 !prefs.IsSyncDisabledByAdmin(); |
155 } | 156 } |
156 | 157 |
157 void Profile::MaybeSendDestroyedNotification() { | 158 void Profile::MaybeSendDestroyedNotification() { |
158 if (!sent_destroyed_notification_) { | 159 if (!sent_destroyed_notification_) { |
159 sent_destroyed_notification_ = true; | 160 sent_destroyed_notification_ = true; |
160 content::NotificationService::current()->Notify( | 161 content::NotificationService::current()->Notify( |
161 chrome::NOTIFICATION_PROFILE_DESTROYED, | 162 chrome::NOTIFICATION_PROFILE_DESTROYED, |
162 content::Source<Profile>(this), | 163 content::Source<Profile>(this), |
163 content::NotificationService::NoDetails()); | 164 content::NotificationService::NoDetails()); |
164 } | 165 } |
165 } | 166 } |
OLD | NEW |