| 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/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 bool Profile::IsGuestSession() const { | 122 bool Profile::IsGuestSession() const { |
| 123 #if defined(OS_CHROMEOS) | 123 #if defined(OS_CHROMEOS) |
| 124 static bool is_guest_session = | 124 static bool is_guest_session = |
| 125 CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession); | 125 CommandLine::ForCurrentProcess()->HasSwitch(switches::kGuestSession); |
| 126 return is_guest_session; | 126 return is_guest_session; |
| 127 #else | 127 #else |
| 128 return false; | 128 return false; |
| 129 #endif | 129 #endif |
| 130 } | 130 } |
| 131 | 131 |
| 132 bool Profile::IsSigninAllowed() { |
| 133 return GetPrefs()->GetBoolean(prefs::kSigninAllowed); |
| 134 } |
| 135 |
| 132 bool Profile::IsSyncAccessible() { | 136 bool Profile::IsSyncAccessible() { |
| 133 browser_sync::SyncPrefs prefs(GetPrefs()); | 137 browser_sync::SyncPrefs prefs(GetPrefs()); |
| 134 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); | 138 return ProfileSyncService::IsSyncEnabled() && !prefs.IsManaged(); |
| 135 } | 139 } |
| 136 | 140 |
| 137 void Profile::MaybeSendDestroyedNotification() { | 141 void Profile::MaybeSendDestroyedNotification() { |
| 138 if (!sent_destroyed_notification_) { | 142 if (!sent_destroyed_notification_) { |
| 139 sent_destroyed_notification_ = true; | 143 sent_destroyed_notification_ = true; |
| 140 content::NotificationService::current()->Notify( | 144 content::NotificationService::current()->Notify( |
| 141 chrome::NOTIFICATION_PROFILE_DESTROYED, | 145 chrome::NOTIFICATION_PROFILE_DESTROYED, |
| 142 content::Source<Profile>(this), | 146 content::Source<Profile>(this), |
| 143 content::NotificationService::NoDetails()); | 147 content::NotificationService::NoDetails()); |
| 144 } | 148 } |
| 145 } | 149 } |
| OLD | NEW |