Chromium Code Reviews| 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 |
| 11 #include "base/bind.h" | 11 #include "base/bind.h" |
| 12 #include "base/callback.h" | 12 #include "base/callback.h" |
| 13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
| 14 #include "base/location.h" | 14 #include "base/location.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/memory/ptr_util.h" | 16 #include "base/memory/ptr_util.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/browser_process_platform_part.h" | 19 #include "chrome/browser/browser_process_platform_part.h" |
| 20 #include "chrome/browser/chromeos/arc/arc_util.h" | |
| 20 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 21 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| 21 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_factory.h" | 22 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_factory.h" |
| 22 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h" | 23 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h" |
| 23 #include "chrome/browser/chromeos/login/reauth_stats.h" | 24 #include "chrome/browser/chromeos/login/reauth_stats.h" |
| 24 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 25 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 25 #include "chrome/browser/chromeos/login/ui/views/user_board_view.h" | 26 #include "chrome/browser/chromeos/login/ui/views/user_board_view.h" |
| 26 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 27 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 27 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" | 28 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" |
| 28 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 29 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 29 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 30 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 if (!quick_unlock_storage) | 140 if (!quick_unlock_storage) |
| 140 return false; | 141 return false; |
| 141 | 142 |
| 142 return quick_unlock_storage->IsFingerprintAuthenticationAvailable(); | 143 return quick_unlock_storage->IsFingerprintAuthenticationAvailable(); |
| 143 } | 144 } |
| 144 | 145 |
| 145 // Returns true if dircrypto migration check should be performed. | 146 // Returns true if dircrypto migration check should be performed. |
| 146 bool ShouldCheckNeedDircryptoMigration() { | 147 bool ShouldCheckNeedDircryptoMigration() { |
| 147 return !base::CommandLine::ForCurrentProcess()->HasSwitch( | 148 return !base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 148 switches::kDisableEncryptionMigration) && | 149 switches::kDisableEncryptionMigration) && |
| 149 arc::IsArcAvailable(); | 150 arc::IsArcAvailable() && arc::IsArcMigrationAllowed(); |
|
bartfab (slow)
2017/06/13 09:56:02
Can we test this?
igorcov
2017/06/16 11:13:04
Couldn't find an easy way to make this.
| |
| 150 } | 151 } |
| 151 | 152 |
| 152 // Returns true if the user can run ARC based on the user type. | 153 // Returns true if the user can run ARC based on the user type. |
| 153 bool IsUserAllowedForARC(const AccountId& account_id) { | 154 bool IsUserAllowedForARC(const AccountId& account_id) { |
| 154 return user_manager::UserManager::IsInitialized() && | 155 return user_manager::UserManager::IsInitialized() && |
| 155 arc::IsArcAllowedForUser( | 156 arc::IsArcAllowedForUser( |
| 156 user_manager::UserManager::Get()->FindUser(account_id)); | 157 user_manager::UserManager::Get()->FindUser(account_id)); |
| 157 } | 158 } |
| 158 | 159 |
| 159 } // namespace | 160 } // namespace |
| (...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 706 // The user profile should exist if and only if this is the lock screen. | 707 // The user profile should exist if and only if this is the lock screen. |
| 707 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); | 708 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); |
| 708 | 709 |
| 709 if (!profile) | 710 if (!profile) |
| 710 profile = profile_helper->GetSigninProfile(); | 711 profile = profile_helper->GetSigninProfile(); |
| 711 | 712 |
| 712 return EasyUnlockService::Get(profile); | 713 return EasyUnlockService::Get(profile); |
| 713 } | 714 } |
| 714 | 715 |
| 715 } // namespace chromeos | 716 } // namespace chromeos |
| OLD | NEW |