| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/signin/chrome_signin_client.h" | 5 #include "chrome/browser/signin/chrome_signin_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/guid.h" | 8 #include "base/guid.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 | 106 |
| 107 scoped_refptr<TokenWebData> ChromeSigninClient::GetDatabase() { | 107 scoped_refptr<TokenWebData> ChromeSigninClient::GetDatabase() { |
| 108 return WebDataServiceFactory::GetTokenWebDataForProfile( | 108 return WebDataServiceFactory::GetTokenWebDataForProfile( |
| 109 profile_, Profile::EXPLICIT_ACCESS); | 109 profile_, Profile::EXPLICIT_ACCESS); |
| 110 } | 110 } |
| 111 | 111 |
| 112 bool ChromeSigninClient::CanRevokeCredentials() { | 112 bool ChromeSigninClient::CanRevokeCredentials() { |
| 113 #if defined(OS_CHROMEOS) | 113 #if defined(OS_CHROMEOS) |
| 114 // UserManager may not exist in unit_tests. | 114 // UserManager may not exist in unit_tests. |
| 115 if (chromeos::UserManager::IsInitialized() && | 115 if (chromeos::UserManager::IsInitialized() && |
| 116 chromeos::UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { | 116 chromeos::UserManager::Get()->IsLoggedInAsSupervisedUser()) { |
| 117 // Don't allow revoking credentials for Chrome OS supervised users. | 117 // Don't allow revoking credentials for Chrome OS supervised users. |
| 118 // See http://crbug.com/332032 | 118 // See http://crbug.com/332032 |
| 119 LOG(ERROR) << "Attempt to revoke supervised user refresh " | 119 LOG(ERROR) << "Attempt to revoke supervised user refresh " |
| 120 << "token detected, ignoring."; | 120 << "token detected, ignoring."; |
| 121 return false; | 121 return false; |
| 122 } | 122 } |
| 123 #else | 123 #else |
| 124 // Don't allow revoking credentials for supervised users. | 124 // Don't allow revoking credentials for supervised users. |
| 125 // See http://crbug.com/332032 | 125 // See http://crbug.com/332032 |
| 126 if (profile_->IsSupervised()) { | 126 if (profile_->IsSupervised()) { |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 | 218 |
| 219 void ChromeSigninClient::UnregisterForCookieChangedNotification() { | 219 void ChromeSigninClient::UnregisterForCookieChangedNotification() { |
| 220 // Note that it's allowed to call this method multiple times without an | 220 // Note that it's allowed to call this method multiple times without an |
| 221 // intervening call to |RegisterForCookieChangedNotification()|. | 221 // intervening call to |RegisterForCookieChangedNotification()|. |
| 222 content::Source<Profile> source(profile_); | 222 content::Source<Profile> source(profile_); |
| 223 if (!registrar_.IsRegistered( | 223 if (!registrar_.IsRegistered( |
| 224 this, chrome::NOTIFICATION_COOKIE_CHANGED, source)) | 224 this, chrome::NOTIFICATION_COOKIE_CHANGED, source)) |
| 225 return; | 225 return; |
| 226 registrar_.Remove(this, chrome::NOTIFICATION_COOKIE_CHANGED, source); | 226 registrar_.Remove(this, chrome::NOTIFICATION_COOKIE_CHANGED, source); |
| 227 } | 227 } |
| OLD | NEW |