| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/chromeos/arc/arc_auth_service.h" | 5 #include "chrome/browser/chromeos/arc/arc_auth_service.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 Shutdown(); | 223 Shutdown(); |
| 224 | 224 |
| 225 user_manager::User const* const user = | 225 user_manager::User const* const user = |
| 226 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); | 226 chromeos::ProfileHelper::Get()->GetUserByProfile(profile); |
| 227 if (profile->IsLegacySupervised() || !user->HasGaiaAccount()) { | 227 if (profile->IsLegacySupervised() || !user->HasGaiaAccount()) { |
| 228 VLOG(2) << "Supervised users and users without GAIA accounts are not " | 228 VLOG(2) << "Supervised users and users without GAIA accounts are not " |
| 229 "supported in Arc."; | 229 "supported in Arc."; |
| 230 return; | 230 return; |
| 231 } | 231 } |
| 232 | 232 |
| 233 if (user_manager::UserManager::Get() |
| 234 ->IsCurrentUserCryptohomeDataEphemeral()) { |
| 235 VLOG(2) << "Users with ephemeral data are not supported in Arc."; |
| 236 return; |
| 237 } |
| 238 |
| 233 profile_ = profile; | 239 profile_ = profile; |
| 234 PrefServiceSyncableFromProfile(profile_)->AddSyncedPrefObserver( | 240 PrefServiceSyncableFromProfile(profile_)->AddSyncedPrefObserver( |
| 235 prefs::kArcEnabled, this); | 241 prefs::kArcEnabled, this); |
| 236 | 242 |
| 237 // Reuse storage used in ARC OptIn platform app. | 243 // Reuse storage used in ARC OptIn platform app. |
| 238 const std::string site_url = | 244 const std::string site_url = |
| 239 base::StringPrintf("%s://%s/persist?%s", content::kGuestScheme, | 245 base::StringPrintf("%s://%s/persist?%s", content::kGuestScheme, |
| 240 kArcSupportExtensionId, kArcSupportStorageId); | 246 kArcSupportExtensionId, kArcSupportStorageId); |
| 241 storage_partition_ = content::BrowserContext::GetStoragePartitionForSite( | 247 storage_partition_ = content::BrowserContext::GetStoragePartitionForSite( |
| 242 profile_, GURL(site_url)); | 248 profile_, GURL(site_url)); |
| (...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 return os << kStateFetchingCode; | 541 return os << kStateFetchingCode; |
| 536 case ArcAuthService::State::ACTIVE: | 542 case ArcAuthService::State::ACTIVE: |
| 537 return os << kStateActive; | 543 return os << kStateActive; |
| 538 default: | 544 default: |
| 539 NOTREACHED(); | 545 NOTREACHED(); |
| 540 return os; | 546 return os; |
| 541 } | 547 } |
| 542 } | 548 } |
| 543 | 549 |
| 544 } // namespace arc | 550 } // namespace arc |
| OLD | NEW |