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" |
11 #include "chrome/browser/chrome_notification_types.h" | 11 #include "chrome/browser/chrome_notification_types.h" |
12 #include "chrome/browser/first_run/first_run.h" | 12 #include "chrome/browser/first_run/first_run.h" |
13 #include "chrome/browser/profiles/profile_manager.h" | 13 #include "chrome/browser/profiles/profile_manager.h" |
14 #include "chrome/browser/sync/profile_sync_service.h" | 14 #include "chrome/browser/sync/profile_sync_service.h" |
15 #include "chrome/browser/sync/profile_sync_service_factory.h" | 15 #include "chrome/browser/sync/profile_sync_service_factory.h" |
16 #include "chrome/browser/sync/sync_prefs.h" | |
17 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 17 #include "components/sync_driver/sync_prefs.h" |
18 #include "components/user_prefs/pref_registry_syncable.h" | 18 #include "components/user_prefs/pref_registry_syncable.h" |
19 #include "content/public/browser/notification_service.h" | 19 #include "content/public/browser/notification_service.h" |
20 #include "content/public/browser/notification_source.h" | 20 #include "content/public/browser/notification_source.h" |
21 #include "content/public/browser/web_contents.h" | 21 #include "content/public/browser/web_contents.h" |
22 #include "content/public/browser/web_ui.h" | 22 #include "content/public/browser/web_ui.h" |
23 #include "extensions/browser/pref_names.h" | 23 #include "extensions/browser/pref_names.h" |
24 | 24 |
25 #if defined(OS_CHROMEOS) | 25 #if defined(OS_CHROMEOS) |
26 #include "base/command_line.h" | 26 #include "base/command_line.h" |
27 #include "chrome/common/chrome_switches.h" | 27 #include "chrome/common/chrome_switches.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 return GetOriginalProfile()->GetPrefs()->GetInitializationStatus() == | 197 return GetOriginalProfile()->GetPrefs()->GetInitializationStatus() == |
198 PrefService::INITIALIZATION_STATUS_CREATED_NEW_PREF_STORE; | 198 PrefService::INITIALIZATION_STATUS_CREATED_NEW_PREF_STORE; |
199 } | 199 } |
200 | 200 |
201 bool Profile::IsSyncAccessible() { | 201 bool Profile::IsSyncAccessible() { |
202 if (ProfileSyncServiceFactory::HasProfileSyncService(this)) | 202 if (ProfileSyncServiceFactory::HasProfileSyncService(this)) |
203 return !ProfileSyncServiceFactory::GetForProfile(this)->IsManaged(); | 203 return !ProfileSyncServiceFactory::GetForProfile(this)->IsManaged(); |
204 | 204 |
205 // No ProfileSyncService created yet - we don't want to create one, so just | 205 // No ProfileSyncService created yet - we don't want to create one, so just |
206 // infer the accessible state by looking at prefs/command line flags. | 206 // infer the accessible state by looking at prefs/command line flags. |
207 browser_sync::SyncPrefs prefs(GetPrefs()); | 207 sync_driver::SyncPrefs prefs(GetPrefs()); |
208 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); | 208 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); |
209 } | 209 } |
210 | 210 |
211 void Profile::MaybeSendDestroyedNotification() { | 211 void Profile::MaybeSendDestroyedNotification() { |
212 if (!sent_destroyed_notification_) { | 212 if (!sent_destroyed_notification_) { |
213 sent_destroyed_notification_ = true; | 213 sent_destroyed_notification_ = true; |
214 content::NotificationService::current()->Notify( | 214 content::NotificationService::current()->Notify( |
215 chrome::NOTIFICATION_PROFILE_DESTROYED, | 215 chrome::NOTIFICATION_PROFILE_DESTROYED, |
216 content::Source<Profile>(this), | 216 content::Source<Profile>(this), |
217 content::NotificationService::NoDetails()); | 217 content::NotificationService::NoDetails()); |
218 } | 218 } |
219 } | 219 } |
OLD | NEW |