| 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/chromeos/login/screens/user_selection_screen.h" | 5 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 | 144 |
| 145 // Returns true if dircrypto migration check should be performed. | 145 // Returns true if dircrypto migration check should be performed. |
| 146 bool ShouldCheckNeedDircryptoMigration() { | 146 bool ShouldCheckNeedDircryptoMigration() { |
| 147 return !base::CommandLine::ForCurrentProcess()->HasSwitch( | 147 return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 148 switches::kDisableEncryptionMigration) && | 148 switches::kDisableEncryptionMigration) && |
| 149 arc::IsArcAvailable(); | 149 arc::IsArcAvailable(); |
| 150 } | 150 } |
| 151 | 151 |
| 152 // Returns true if the user can run ARC based on the user type. | 152 // Returns true if the user can run ARC based on the user type. |
| 153 bool IsUserAllowedForARC(const AccountId& account_id) { | 153 bool IsUserAllowedForARC(const AccountId& account_id) { |
| 154 if (!user_manager::UserManager::IsInitialized()) | 154 return user_manager::UserManager::IsInitialized() && |
| 155 return false; | 155 arc::IsArcAllowedForUser( |
| 156 | 156 user_manager::UserManager::Get()->FindUser(account_id)); |
| 157 const user_manager::User* user = | |
| 158 user_manager::UserManager::Get()->FindUser(account_id); | |
| 159 if (!user) | |
| 160 return false; | |
| 161 | |
| 162 return user->HasGaiaAccount() || user->IsActiveDirectoryUser(); | |
| 163 } | 157 } |
| 164 | 158 |
| 165 } // namespace | 159 } // namespace |
| 166 | 160 |
| 167 // Helper class to call cryptohome to check whether a user needs dircrypto | 161 // Helper class to call cryptohome to check whether a user needs dircrypto |
| 168 // migration. The check results are cached to limit calls to cryptohome. | 162 // migration. The check results are cached to limit calls to cryptohome. |
| 169 class UserSelectionScreen::DircryptoMigrationChecker { | 163 class UserSelectionScreen::DircryptoMigrationChecker { |
| 170 public: | 164 public: |
| 171 explicit DircryptoMigrationChecker(UserSelectionScreen* owner) | 165 explicit DircryptoMigrationChecker(UserSelectionScreen* owner) |
| 172 : owner_(owner), weak_ptr_factory_(this) {} | 166 : owner_(owner), weak_ptr_factory_(this) {} |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 // The user profile should exist if and only if this is the lock screen. | 706 // The user profile should exist if and only if this is the lock screen. |
| 713 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); | 707 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); |
| 714 | 708 |
| 715 if (!profile) | 709 if (!profile) |
| 716 profile = profile_helper->GetSigninProfile(); | 710 profile = profile_helper->GetSigninProfile(); |
| 717 | 711 |
| 718 return EasyUnlockService::Get(profile); | 712 return EasyUnlockService::Get(profile); |
| 719 } | 713 } |
| 720 | 714 |
| 721 } // namespace chromeos | 715 } // namespace chromeos |
| OLD | NEW |