Move chrome/browser/ash/login/quick_unlock/ to namespace ash
The migration of chromeos/browser/chromeos/login/quick_unlock/ was finished in https://crrev.com/c/2721915. This CL changes the namespace from chromeos to ash. Compatibility code is added until the Chrome OS source code migration is finished. This CL is part of the Chrome OS source code directory migration: https://docs.google.com/document/d/1g-98HpzA8XcoGBWUv1gQNr4rbnD5yfvbtYZyPDDbkaE. Bug: 1164001 Change-Id: I6b5c7315a09cf86d1134b7af1eb15e1d0d92ee7d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3017877 Commit-Queue: Henrique Ferreiro <hferreiro@igalia.com> Reviewed-by: Hidehiko Abe <hidehiko@chromium.org> Owners-Override: Hidehiko Abe <hidehiko@chromium.org> Cr-Commit-Position: refs/heads/master@{#902927}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
081122ecd7
commit
b3ff980b15
chrome/browser
ash
login
quick_unlock
auth_token.ccauth_token.hfingerprint_storage.ccfingerprint_storage.hfingerprint_storage_unittest.ccpin_backend.ccpin_backend.hpin_migration_browsertest.ccpin_storage_cryptohome.ccpin_storage_cryptohome.hpin_storage_cryptohome_unittest.ccpin_storage_prefs.ccpin_storage_prefs.hpin_storage_prefs_unittest.ccquick_unlock_factory.ccquick_unlock_factory.hquick_unlock_storage.ccquick_unlock_storage.hquick_unlock_storage_unittest.ccquick_unlock_utils.ccquick_unlock_utils.h
screens
web_applications
help_app
chromeos
extensions
quick_unlock_private
multidevice_setup
extensions
api
passwords_private
prefs
ui
ash
webui
chromeos
login
settings
chromeos/login/auth
docs/login
@ -9,7 +9,7 @@
|
||||
#include "base/threading/thread_task_runner_handle.h"
|
||||
#include "chromeos/login/auth/user_context.h"
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
|
||||
const int AuthToken::kTokenExpirationSeconds = 5 * 60;
|
||||
@ -44,4 +44,4 @@ void AuthToken::Reset() {
|
||||
}
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
@ -15,7 +15,9 @@
|
||||
|
||||
namespace chromeos {
|
||||
class UserContext;
|
||||
}
|
||||
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
|
||||
// Security token with an identifyier string and a predetermined life time,
|
||||
@ -59,14 +61,14 @@ class AuthToken {
|
||||
};
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
||||
// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
|
||||
// source migration is finished.
|
||||
namespace ash {
|
||||
namespace chromeos {
|
||||
namespace quick_unlock {
|
||||
using ::chromeos::quick_unlock::AuthToken;
|
||||
using ::ash::quick_unlock::AuthToken;
|
||||
}
|
||||
} // namespace ash
|
||||
} // namespace chromeos
|
||||
|
||||
#endif // CHROME_BROWSER_ASH_LOGIN_QUICK_UNLOCK_AUTH_TOKEN_H_
|
||||
|
@ -16,9 +16,8 @@
|
||||
#include "content/public/browser/device_service.h"
|
||||
#include "services/device/public/mojom/fingerprint.mojom.h"
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr char kFingerprintUMAFeatureName[] = "Fingerprint";
|
||||
@ -143,4 +142,4 @@ void FingerprintStorage::OnGetRecords(
|
||||
}
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
@ -13,10 +13,9 @@
|
||||
class PrefRegistrySimple;
|
||||
class Profile;
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
class FingerprintMetricsReporter;
|
||||
class QuickUnlockStorage;
|
||||
|
||||
// The result of fingerprint auth attempt on the lock screen. These values are
|
||||
// persisted to logs. Entries should not be renumbered and numeric values
|
||||
@ -92,14 +91,14 @@ class FingerprintStorage : public feature_usage::FeatureUsageMetrics::Delegate {
|
||||
};
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
||||
// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
|
||||
// source migration is finished.
|
||||
namespace ash {
|
||||
namespace chromeos {
|
||||
namespace quick_unlock {
|
||||
using ::chromeos::quick_unlock::FingerprintUnlockResult;
|
||||
using ::ash::quick_unlock::FingerprintUnlockResult;
|
||||
}
|
||||
} // namespace ash
|
||||
} // namespace chromeos
|
||||
|
||||
#endif // CHROME_BROWSER_ASH_LOGIN_QUICK_UNLOCK_FINGERPRINT_STORAGE_H_
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "content/public/test/browser_task_environment.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
namespace {
|
||||
|
||||
@ -111,4 +111,4 @@ TEST_F(FingerprintStorageUnitTest, AuthenticationUnAvailable) {
|
||||
}
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
@ -26,9 +26,8 @@
|
||||
#include "components/user_manager/known_user.h"
|
||||
#include "crypto/random.h"
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr int kSaltByteSize = 16;
|
||||
@ -219,7 +218,7 @@ void PinBackend::SetPinAutoSubmitEnabled(const AccountId& account_id,
|
||||
// If the preference is not user controllable, the auto submit dialog
|
||||
// isn't available in Settings, so we return a failure.
|
||||
if (!PrefService(account_id)
|
||||
->IsUserModifiablePreference(prefs::kPinUnlockAutosubmitEnabled)) {
|
||||
->IsUserModifiablePreference(::prefs::kPinUnlockAutosubmitEnabled)) {
|
||||
PostResponse(std::move(did_set), false);
|
||||
return;
|
||||
}
|
||||
@ -233,7 +232,7 @@ void PinBackend::SetPinAutoSubmitEnabled(const AccountId& account_id,
|
||||
} else {
|
||||
user_manager::known_user::SetUserPinLength(account_id, 0);
|
||||
PrefService(account_id)
|
||||
->SetBoolean(prefs::kPinUnlockAutosubmitEnabled, false);
|
||||
->SetBoolean(::prefs::kPinUnlockAutosubmitEnabled, false);
|
||||
PostResponse(std::move(did_set), true);
|
||||
}
|
||||
}
|
||||
@ -346,7 +345,7 @@ int PinBackend::GetExposedPinLength(const AccountId& account_id) {
|
||||
// example, via policy. Disabling auto submit through Settings clears it
|
||||
// immediately.
|
||||
if (!PrefService(account_id)
|
||||
->GetBoolean(prefs::kPinUnlockAutosubmitEnabled)) {
|
||||
->GetBoolean(::prefs::kPinUnlockAutosubmitEnabled)) {
|
||||
user_manager::known_user::SetUserPinLength(account_id, 0);
|
||||
return 0;
|
||||
}
|
||||
@ -393,14 +392,12 @@ void PinBackend::OnPinAutosubmitCheckComplete(const AccountId& account_id,
|
||||
user_manager::known_user::SetUserPinLength(account_id,
|
||||
success ? pin_length : 0);
|
||||
PrefService(account_id)
|
||||
->SetBoolean(prefs::kPinUnlockAutosubmitEnabled, success);
|
||||
->SetBoolean(::prefs::kPinUnlockAutosubmitEnabled, success);
|
||||
PostResponse(std::move(result), success);
|
||||
}
|
||||
|
||||
PrefService* PinBackend::PrefService(const AccountId& account_id) {
|
||||
return chromeos::ProfileHelper::Get()
|
||||
->GetProfileByAccountId(account_id)
|
||||
->GetPrefs();
|
||||
return ProfileHelper::Get()->GetProfileByAccountId(account_id)->GetPrefs();
|
||||
}
|
||||
|
||||
void PinBackend::UpdatePinAutosubmitOnSet(const AccountId& account_id,
|
||||
@ -413,7 +410,8 @@ void PinBackend::UpdatePinAutosubmitOnSet(const AccountId& account_id,
|
||||
user_manager::known_user::PinAutosubmitSetBackfillNotNeeded(account_id);
|
||||
|
||||
const bool autosubmit_enabled =
|
||||
PrefService(account_id)->GetBoolean(prefs::kPinUnlockAutosubmitEnabled) &&
|
||||
PrefService(account_id)
|
||||
->GetBoolean(::prefs::kPinUnlockAutosubmitEnabled) &&
|
||||
pin_length <= kPinAutosubmitMaxPinLength;
|
||||
|
||||
// Explicitly set the user pref to false if the PIN is longer than 12 digits
|
||||
@ -421,7 +419,7 @@ void PinBackend::UpdatePinAutosubmitOnSet(const AccountId& account_id,
|
||||
// tries to enable the toggle with a long pin an error is shown.
|
||||
if (pin_length > kPinAutosubmitMaxPinLength) {
|
||||
PrefService(account_id)
|
||||
->SetBoolean(prefs::kPinUnlockAutosubmitEnabled, false);
|
||||
->SetBoolean(::prefs::kPinUnlockAutosubmitEnabled, false);
|
||||
}
|
||||
|
||||
// Expose the true PIN length if enabled
|
||||
@ -433,7 +431,7 @@ void PinBackend::UpdatePinAutosubmitOnRemove(const AccountId& account_id) {
|
||||
if (!features::IsPinAutosubmitFeatureEnabled())
|
||||
return;
|
||||
user_manager::known_user::SetUserPinLength(account_id, 0);
|
||||
PrefService(account_id)->ClearPref(prefs::kPinUnlockAutosubmitEnabled);
|
||||
PrefService(account_id)->ClearPref(::prefs::kPinUnlockAutosubmitEnabled);
|
||||
}
|
||||
|
||||
void PinBackend::UpdatePinAutosubmitOnSuccessfulTryAuth(
|
||||
@ -447,7 +445,8 @@ void PinBackend::UpdatePinAutosubmitOnSuccessfulTryAuth(
|
||||
PinAutosubmitBackfill(account_id, pin_length);
|
||||
|
||||
const bool autosubmit_enabled =
|
||||
PrefService(account_id)->GetBoolean(prefs::kPinUnlockAutosubmitEnabled) &&
|
||||
PrefService(account_id)
|
||||
->GetBoolean(::prefs::kPinUnlockAutosubmitEnabled) &&
|
||||
pin_length <= kPinAutosubmitMaxPinLength;
|
||||
if (autosubmit_enabled)
|
||||
user_manager::known_user::SetUserPinLength(account_id, pin_length);
|
||||
@ -467,17 +466,17 @@ void PinBackend::PinAutosubmitBackfill(const AccountId& account_id,
|
||||
|
||||
// Dont backfill if there is a user value set for the pref.
|
||||
if (PrefService(account_id)
|
||||
->GetUserPrefValue(prefs::kPinUnlockAutosubmitEnabled) != nullptr)
|
||||
->GetUserPrefValue(::prefs::kPinUnlockAutosubmitEnabled) != nullptr)
|
||||
return;
|
||||
|
||||
// Disabled if not allowed by policy. Since 'kPinUnlockAutosubmitEnabled'
|
||||
// is enabled by default, it is only false when recommended/mandatory by
|
||||
// policy.
|
||||
if (!PrefService(account_id)
|
||||
->GetBoolean(prefs::kPinUnlockAutosubmitEnabled)) {
|
||||
->GetBoolean(::prefs::kPinUnlockAutosubmitEnabled)) {
|
||||
RecordUMAHistogram(BackfillEvent::kDisabledDueToPolicy);
|
||||
PrefService(account_id)
|
||||
->SetBoolean(prefs::kPinUnlockAutosubmitEnabled, false);
|
||||
->SetBoolean(::prefs::kPinUnlockAutosubmitEnabled, false);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -485,13 +484,13 @@ void PinBackend::PinAutosubmitBackfill(const AccountId& account_id,
|
||||
if (pin_length != kPinAutosubmitBackfillLength) {
|
||||
RecordUMAHistogram(BackfillEvent::kDisabledDueToPinLength);
|
||||
PrefService(account_id)
|
||||
->SetBoolean(prefs::kPinUnlockAutosubmitEnabled, false);
|
||||
->SetBoolean(::prefs::kPinUnlockAutosubmitEnabled, false);
|
||||
} else {
|
||||
RecordUMAHistogram(BackfillEvent::kEnabled);
|
||||
PrefService(account_id)
|
||||
->SetBoolean(prefs::kPinUnlockAutosubmitEnabled, true);
|
||||
->SetBoolean(::prefs::kPinUnlockAutosubmitEnabled, true);
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
@ -15,10 +15,8 @@ class AccountId;
|
||||
class Profile;
|
||||
class ScopedKeepAlive;
|
||||
|
||||
namespace chromeos {
|
||||
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
|
||||
class PinStorageCryptohome;
|
||||
|
||||
// Provides high-level access to the user's PIN. The underlying storage can be
|
||||
@ -177,14 +175,14 @@ class PinBackend {
|
||||
};
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
||||
// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
|
||||
// source migration is finished.
|
||||
namespace ash {
|
||||
namespace chromeos {
|
||||
namespace quick_unlock {
|
||||
using ::chromeos::quick_unlock::PinBackend;
|
||||
using ::ash::quick_unlock::PinBackend;
|
||||
}
|
||||
} // namespace ash
|
||||
} // namespace chromeos
|
||||
|
||||
#endif // CHROME_BROWSER_ASH_LOGIN_QUICK_UNLOCK_PIN_BACKEND_H_
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "content/public/test/browser_test.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
namespace {
|
||||
|
||||
@ -100,4 +100,4 @@ IN_PROC_BROWSER_TEST_F(PinMigrationTest, Migrate) {
|
||||
|
||||
} // namespace
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
@ -20,23 +20,22 @@
|
||||
#include "components/account_id/account_id.h"
|
||||
#include "components/user_manager/known_user.h"
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
|
||||
namespace {
|
||||
|
||||
// Read the salt from local state.
|
||||
std::string GetSalt(const AccountId& account_id) {
|
||||
std::string salt;
|
||||
user_manager::known_user::GetStringPref(
|
||||
account_id, ash::prefs::kQuickUnlockPinSalt, &salt);
|
||||
user_manager::known_user::GetStringPref(account_id,
|
||||
prefs::kQuickUnlockPinSalt, &salt);
|
||||
return salt;
|
||||
}
|
||||
|
||||
// Write the salt to local state.
|
||||
void WriteSalt(const AccountId& account_id, const std::string& salt) {
|
||||
user_manager::known_user::SetStringPref(
|
||||
account_id, ash::prefs::kQuickUnlockPinSalt, salt);
|
||||
user_manager::known_user::SetStringPref(account_id,
|
||||
prefs::kQuickUnlockPinSalt, salt);
|
||||
}
|
||||
|
||||
template <typename ReplyType>
|
||||
@ -290,4 +289,4 @@ void PinStorageCryptohome::TryAuthenticate(const AccountId& account_id,
|
||||
}
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
@ -9,15 +9,13 @@
|
||||
|
||||
#include "base/callback.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
// TODO(https://crbug.com/1164001): move to forward declaration
|
||||
#include "chromeos/login/auth/user_context.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
|
||||
class AccountId;
|
||||
|
||||
namespace chromeos {
|
||||
|
||||
class UserContext;
|
||||
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
|
||||
class PinStorageCryptohome {
|
||||
@ -62,6 +60,14 @@ class PinStorageCryptohome {
|
||||
};
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace ash
|
||||
|
||||
// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
|
||||
// source migration is finished.
|
||||
namespace chromeos {
|
||||
namespace quick_unlock {
|
||||
using ::ash::quick_unlock::PinStorageCryptohome;
|
||||
}
|
||||
} // namespace chromeos
|
||||
|
||||
#endif // CHROME_BROWSER_ASH_LOGIN_QUICK_UNLOCK_PIN_STORAGE_CRYPTOHOME_H_
|
||||
|
@ -21,9 +21,8 @@
|
||||
#include "content/public/test/browser_task_environment.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
|
||||
namespace {
|
||||
|
||||
constexpr char kDummyPin[] = "123456";
|
||||
@ -35,7 +34,7 @@ class PinStorageCryptohomeUnitTest : public testing::Test {
|
||||
|
||||
// testing::Test:
|
||||
void SetUp() override {
|
||||
quick_unlock::EnabledForTesting(true);
|
||||
EnabledForTesting(true);
|
||||
SystemSaltGetter::Initialize();
|
||||
CryptohomeMiscClient::InitializeFake();
|
||||
UserDataAuthClient::InitializeFake();
|
||||
@ -47,8 +46,8 @@ class PinStorageCryptohomeUnitTest : public testing::Test {
|
||||
UserDataAuthClient::Shutdown();
|
||||
CryptohomeMiscClient::Shutdown();
|
||||
SystemSaltGetter::Shutdown();
|
||||
quick_unlock::EnabledForTesting(false);
|
||||
quick_unlock::IsFingerprintEnabled(nullptr);
|
||||
EnabledForTesting(false);
|
||||
IsFingerprintEnabled(nullptr);
|
||||
}
|
||||
|
||||
bool IsPinSet() const {
|
||||
@ -227,4 +226,4 @@ TEST_F(PinStorageCryptohomeUnitTest, AuthLockedTest) {
|
||||
}
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
@ -10,12 +10,12 @@
|
||||
#include "components/prefs/pref_registry_simple.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
|
||||
// static
|
||||
void PinStoragePrefs::RegisterProfilePrefs(PrefRegistrySimple* registry) {
|
||||
registry->RegisterStringPref(ash::prefs::kQuickUnlockPinSalt, "");
|
||||
registry->RegisterStringPref(prefs::kQuickUnlockPinSalt, "");
|
||||
registry->RegisterStringPref(prefs::kQuickUnlockPinSecret, "");
|
||||
}
|
||||
|
||||
@ -41,17 +41,17 @@ void PinStoragePrefs::SetPin(const std::string& pin) {
|
||||
const std::string secret =
|
||||
PinBackend::ComputeSecret(pin, salt, Key::KEY_TYPE_PASSWORD_PLAIN);
|
||||
|
||||
pref_service_->SetString(ash::prefs::kQuickUnlockPinSalt, salt);
|
||||
pref_service_->SetString(prefs::kQuickUnlockPinSalt, salt);
|
||||
pref_service_->SetString(prefs::kQuickUnlockPinSecret, secret);
|
||||
}
|
||||
|
||||
void PinStoragePrefs::RemovePin() {
|
||||
pref_service_->SetString(ash::prefs::kQuickUnlockPinSalt, "");
|
||||
pref_service_->SetString(prefs::kQuickUnlockPinSalt, "");
|
||||
pref_service_->SetString(prefs::kQuickUnlockPinSecret, "");
|
||||
}
|
||||
|
||||
std::string PinStoragePrefs::PinSalt() const {
|
||||
return pref_service_->GetString(ash::prefs::kQuickUnlockPinSalt);
|
||||
return pref_service_->GetString(prefs::kQuickUnlockPinSalt);
|
||||
}
|
||||
|
||||
std::string PinStoragePrefs::PinSecret() const {
|
||||
@ -76,4 +76,4 @@ bool PinStoragePrefs::TryAuthenticatePin(const Key& key) {
|
||||
}
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
@ -14,7 +14,7 @@
|
||||
class PrefRegistrySimple;
|
||||
class PrefService;
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
|
||||
class PinStoragePrefs {
|
||||
@ -62,6 +62,6 @@ class PinStoragePrefs {
|
||||
};
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
||||
#endif // CHROME_BROWSER_ASH_LOGIN_QUICK_UNLOCK_PIN_STORAGE_PREFS_H_
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "content/public/test/browser_task_environment.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
namespace {
|
||||
|
||||
@ -72,7 +72,7 @@ class PinStoragePrefsTestApi {
|
||||
TEST_F(PinStoragePrefsUnitTest, PinStorageWritesToPrefs) {
|
||||
PrefService* prefs = profile_->GetPrefs();
|
||||
|
||||
EXPECT_EQ("", prefs->GetString(ash::prefs::kQuickUnlockPinSalt));
|
||||
EXPECT_EQ("", prefs->GetString(prefs::kQuickUnlockPinSalt));
|
||||
EXPECT_EQ("", prefs->GetString(prefs::kQuickUnlockPinSecret));
|
||||
|
||||
PinStoragePrefsTestApi pin_storage_test(PinStoragePrefs());
|
||||
@ -80,7 +80,7 @@ TEST_F(PinStoragePrefsUnitTest, PinStorageWritesToPrefs) {
|
||||
PinStoragePrefs()->SetPin("1111");
|
||||
EXPECT_TRUE(PinStoragePrefs()->IsPinSet());
|
||||
EXPECT_EQ(pin_storage_test.PinSalt(),
|
||||
prefs->GetString(ash::prefs::kQuickUnlockPinSalt));
|
||||
prefs->GetString(prefs::kQuickUnlockPinSalt));
|
||||
EXPECT_EQ(pin_storage_test.PinSecret(),
|
||||
prefs->GetString(prefs::kQuickUnlockPinSecret));
|
||||
EXPECT_NE("", pin_storage_test.PinSalt());
|
||||
@ -88,7 +88,7 @@ TEST_F(PinStoragePrefsUnitTest, PinStorageWritesToPrefs) {
|
||||
|
||||
PinStoragePrefs()->RemovePin();
|
||||
EXPECT_FALSE(PinStoragePrefs()->IsPinSet());
|
||||
EXPECT_EQ("", prefs->GetString(ash::prefs::kQuickUnlockPinSalt));
|
||||
EXPECT_EQ("", prefs->GetString(prefs::kQuickUnlockPinSalt));
|
||||
EXPECT_EQ("", prefs->GetString(prefs::kQuickUnlockPinSecret));
|
||||
}
|
||||
|
||||
@ -156,4 +156,4 @@ TEST_F(PinStoragePrefsUnitTest, AuthenticationWithHashedPin) {
|
||||
}
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "components/user_manager/user.h"
|
||||
#include "components/user_manager/user_manager.h"
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
|
||||
// static
|
||||
@ -59,4 +59,4 @@ KeyedService* QuickUnlockFactory::BuildServiceInstanceFor(
|
||||
}
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
@ -15,9 +15,8 @@ namespace user_manager {
|
||||
class User;
|
||||
}
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
|
||||
class QuickUnlockStorage;
|
||||
|
||||
// Singleton that owns all QuickUnlockStorage instances and associates them with
|
||||
@ -53,14 +52,14 @@ class QuickUnlockFactory : public BrowserContextKeyedServiceFactory {
|
||||
};
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
||||
// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
|
||||
// source migration is finished.
|
||||
namespace ash {
|
||||
namespace chromeos {
|
||||
namespace quick_unlock {
|
||||
using ::chromeos::quick_unlock::QuickUnlockFactory;
|
||||
using ::ash::quick_unlock::QuickUnlockFactory;
|
||||
}
|
||||
} // namespace ash
|
||||
} // namespace chromeos
|
||||
|
||||
#endif // CHROME_BROWSER_ASH_LOGIN_QUICK_UNLOCK_QUICK_UNLOCK_FACTORY_H_
|
||||
|
@ -15,9 +15,8 @@
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
|
||||
namespace {
|
||||
|
||||
base::TimeDelta GetStrongAuthTimeout(PrefService* pref_service) {
|
||||
@ -101,4 +100,4 @@ void QuickUnlockStorage::Shutdown() {
|
||||
}
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
class Profile;
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
class AuthToken;
|
||||
class FingerprintStorage;
|
||||
@ -97,14 +97,14 @@ class QuickUnlockStorage : public KeyedService {
|
||||
};
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
||||
// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
|
||||
// source migration is finished.
|
||||
namespace ash {
|
||||
namespace chromeos {
|
||||
namespace quick_unlock {
|
||||
using ::chromeos::quick_unlock::QuickUnlockStorage;
|
||||
using ::ash::quick_unlock::QuickUnlockStorage;
|
||||
}
|
||||
} // namespace ash
|
||||
} // namespace chromeos
|
||||
|
||||
#endif // CHROME_BROWSER_ASH_LOGIN_QUICK_UNLOCK_QUICK_UNLOCK_STORAGE_H_
|
||||
|
@ -19,7 +19,7 @@
|
||||
#include "content/public/test/browser_task_environment.h"
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
namespace {
|
||||
|
||||
@ -176,4 +176,4 @@ TEST_F(QuickUnlockStorageUnitTest, AuthToken) {
|
||||
}
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
@ -23,10 +23,10 @@
|
||||
#include "content/public/browser/web_ui_data_source.h"
|
||||
#include "services/network/public/mojom/content_security_policy.mojom.h"
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
|
||||
namespace {
|
||||
|
||||
// Quick unlock is enabled regardless of flags.
|
||||
bool enable_for_testing_ = false;
|
||||
bool disable_pin_by_policy_for_testing_ = false;
|
||||
@ -222,4 +222,4 @@ void DisablePinByPolicyForTesting(bool disable) {
|
||||
}
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
@ -17,7 +17,7 @@ class PrefRegistrySimple;
|
||||
class PrefService;
|
||||
class Profile;
|
||||
|
||||
namespace chromeos {
|
||||
namespace ash {
|
||||
namespace quick_unlock {
|
||||
|
||||
// Enumeration specifying the possible intervals before a strong auth
|
||||
@ -82,19 +82,21 @@ void DisablePinByPolicyForTesting(bool disable);
|
||||
void AddFingerprintResources(content::WebUIDataSource* html_source);
|
||||
|
||||
} // namespace quick_unlock
|
||||
} // namespace chromeos
|
||||
} // namespace ash
|
||||
|
||||
// TODO(https://crbug.com/1164001): remove after the //chrome/browser/chromeos
|
||||
// source migration is finished.
|
||||
namespace ash {
|
||||
namespace chromeos {
|
||||
namespace quick_unlock {
|
||||
using ::chromeos::quick_unlock::DisablePinByPolicyForTesting;
|
||||
using ::chromeos::quick_unlock::EnabledForTesting;
|
||||
using ::chromeos::quick_unlock::IsPinDisabledByPolicy;
|
||||
using ::chromeos::quick_unlock::IsPinEnabled;
|
||||
using ::chromeos::quick_unlock::PasswordConfirmationFrequency;
|
||||
using ::chromeos::quick_unlock::PasswordConfirmationFrequencyToTimeDelta;
|
||||
using ::ash::quick_unlock::AddFingerprintResources;
|
||||
using ::ash::quick_unlock::DisablePinByPolicyForTesting;
|
||||
using ::ash::quick_unlock::EnabledForTesting;
|
||||
using ::ash::quick_unlock::FingerprintLocation;
|
||||
using ::ash::quick_unlock::GetFingerprintLocation;
|
||||
using ::ash::quick_unlock::IsFingerprintEnabled;
|
||||
using ::ash::quick_unlock::IsPinDisabledByPolicy;
|
||||
using ::ash::quick_unlock::IsPinEnabled;
|
||||
} // namespace quick_unlock
|
||||
} // namespace ash
|
||||
} // namespace chromeos
|
||||
|
||||
#endif // CHROME_BROWSER_ASH_LOGIN_QUICK_UNLOCK_QUICK_UNLOCK_UTILS_H_
|
||||
|
@ -120,7 +120,7 @@ FingerprintSetupScreen::~FingerprintSetupScreen() {
|
||||
}
|
||||
|
||||
bool FingerprintSetupScreen::MaybeSkip(WizardContext* context) {
|
||||
if (!chromeos::quick_unlock::IsFingerprintEnabled(
|
||||
if (!quick_unlock::IsFingerprintEnabled(
|
||||
ProfileManager::GetActiveUserProfile()) ||
|
||||
chrome_user_manager_util::IsPublicSessionOrEphemeralLogin()) {
|
||||
exit_callback_.Run(Result::NOT_APPLICABLE);
|
||||
|
@ -175,11 +175,11 @@ void PinSetupScreen::ShowImpl() {
|
||||
token_lifetime_timeout_.Start(
|
||||
FROM_HERE,
|
||||
base::TimeDelta::FromSeconds(
|
||||
chromeos::quick_unlock::AuthToken::kTokenExpirationSeconds),
|
||||
quick_unlock::AuthToken::kTokenExpirationSeconds),
|
||||
base::BindOnce(&PinSetupScreen::OnTokenTimedOut,
|
||||
weak_ptr_factory_.GetWeakPtr()));
|
||||
chromeos::quick_unlock::QuickUnlockStorage* quick_unlock_storage =
|
||||
chromeos::quick_unlock::QuickUnlockFactory::GetForProfile(
|
||||
quick_unlock::QuickUnlockStorage* quick_unlock_storage =
|
||||
quick_unlock::QuickUnlockFactory::GetForProfile(
|
||||
ProfileManager::GetActiveUserProfile());
|
||||
quick_unlock_storage->MarkStrongAuth();
|
||||
std::unique_ptr<UserContext> user_context =
|
||||
@ -198,9 +198,8 @@ void PinSetupScreen::ShowImpl() {
|
||||
if (view_)
|
||||
view_->Show(token, is_child_account);
|
||||
|
||||
chromeos::quick_unlock::PinBackend::GetInstance()->HasLoginSupport(
|
||||
base::BindOnce(&PinSetupScreen::OnHasLoginSupport,
|
||||
weak_ptr_factory_.GetWeakPtr()));
|
||||
quick_unlock::PinBackend::GetInstance()->HasLoginSupport(base::BindOnce(
|
||||
&PinSetupScreen::OnHasLoginSupport, weak_ptr_factory_.GetWeakPtr()));
|
||||
}
|
||||
|
||||
void PinSetupScreen::HideImpl() {
|
||||
|
@ -127,7 +127,7 @@ void PopulateLoadTimeData(content::WebUI* web_ui,
|
||||
ash::AssistantState::Get()->settings_enabled().value_or(false));
|
||||
source->AddBoolean("playStoreEnabled",
|
||||
arc::IsArcPlayStoreEnabledForProfile(profile));
|
||||
source->AddBoolean("pinEnabled", chromeos::quick_unlock::IsPinEnabled());
|
||||
source->AddBoolean("pinEnabled", ash::quick_unlock::IsPinEnabled());
|
||||
|
||||
// Data about what type of account/login this is.
|
||||
user_manager::UserManager* user_manager = user_manager::UserManager::Get();
|
||||
|
@ -45,9 +45,9 @@ using CredentialCheck = quick_unlock_private::CredentialCheck;
|
||||
using CredentialRequirements = quick_unlock_private::CredentialRequirements;
|
||||
using QuickUnlockMode = quick_unlock_private::QuickUnlockMode;
|
||||
|
||||
using AuthToken = chromeos::quick_unlock::AuthToken;
|
||||
using AuthToken = ash::quick_unlock::AuthToken;
|
||||
using QuickUnlockModeList = std::vector<QuickUnlockMode>;
|
||||
using QuickUnlockStorage = chromeos::quick_unlock::QuickUnlockStorage;
|
||||
using QuickUnlockStorage = ash::quick_unlock::QuickUnlockStorage;
|
||||
|
||||
using ActiveModeCallback = base::OnceCallback<void(const QuickUnlockModeList&)>;
|
||||
|
||||
@ -82,7 +82,7 @@ constexpr const char* kMostCommonPins[] = {"1212", "1004", "2000", "6969",
|
||||
void ComputeActiveModes(Profile* profile, ActiveModeCallback result) {
|
||||
user_manager::User* user =
|
||||
chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
|
||||
chromeos::quick_unlock::PinBackend::GetInstance()->IsSet(
|
||||
ash::quick_unlock::PinBackend::GetInstance()->IsSet(
|
||||
user->GetAccountId(),
|
||||
base::BindOnce(
|
||||
[](ActiveModeCallback result, bool is_set) {
|
||||
@ -202,7 +202,7 @@ Profile* GetActiveProfile(content::BrowserContext* browser_context) {
|
||||
}
|
||||
|
||||
AuthToken* GetActiveProfileAuthToken(content::BrowserContext* browser_context) {
|
||||
return chromeos::quick_unlock::QuickUnlockFactory::GetForProfile(
|
||||
return ash::quick_unlock::QuickUnlockFactory::GetForProfile(
|
||||
GetActiveProfile(browser_context))
|
||||
->GetAuthToken();
|
||||
}
|
||||
@ -276,7 +276,7 @@ void QuickUnlockPrivateGetAuthTokenFunction::OnAuthSuccess(
|
||||
|
||||
Profile* profile = GetActiveProfile(browser_context());
|
||||
QuickUnlockStorage* quick_unlock_storage =
|
||||
chromeos::quick_unlock::QuickUnlockFactory::GetForProfile(profile);
|
||||
ash::quick_unlock::QuickUnlockFactory::GetForProfile(profile);
|
||||
quick_unlock_storage->MarkStrongAuth();
|
||||
result->token = quick_unlock_storage->CreateAuthToken(user_context);
|
||||
result->lifetime_seconds = AuthToken::kTokenExpirationSeconds;
|
||||
@ -342,7 +342,7 @@ QuickUnlockPrivateSetPinAutosubmitEnabledFunction::Run() {
|
||||
user_manager::User* user =
|
||||
chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
|
||||
|
||||
chromeos::quick_unlock::PinBackend::GetInstance()->SetPinAutoSubmitEnabled(
|
||||
ash::quick_unlock::PinBackend::GetInstance()->SetPinAutoSubmitEnabled(
|
||||
user->GetAccountId(), params->pin, params->enabled,
|
||||
base::BindOnce(&QuickUnlockPrivateSetPinAutosubmitEnabledFunction::
|
||||
HandleSetPinAutoSubmitResult,
|
||||
@ -376,7 +376,7 @@ QuickUnlockPrivateCanAuthenticatePinFunction::Run() {
|
||||
user_manager::User* user =
|
||||
chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
|
||||
|
||||
chromeos::quick_unlock::PinBackend::GetInstance()->CanAuthenticate(
|
||||
ash::quick_unlock::PinBackend::GetInstance()->CanAuthenticate(
|
||||
user->GetAccountId(),
|
||||
base::BindOnce(&QuickUnlockPrivateCanAuthenticatePinFunction::
|
||||
HandleCanAuthenticateResult,
|
||||
@ -402,7 +402,7 @@ QuickUnlockPrivateGetAvailableModesFunction::
|
||||
ExtensionFunction::ResponseAction
|
||||
QuickUnlockPrivateGetAvailableModesFunction::Run() {
|
||||
QuickUnlockModeList modes;
|
||||
if (!chromeos::quick_unlock::IsPinDisabledByPolicy(
|
||||
if (!ash::quick_unlock::IsPinDisabledByPolicy(
|
||||
GetActiveProfile(browser_context())->GetPrefs())) {
|
||||
modes.push_back(quick_unlock_private::QUICK_UNLOCK_MODE_PIN);
|
||||
}
|
||||
@ -539,7 +539,7 @@ ExtensionFunction::ResponseAction QuickUnlockPrivateSetModesFunction::Run() {
|
||||
// on the UI, but users can still reach here via dev tools.
|
||||
for (size_t i = 0; i < params_->modes.size(); ++i) {
|
||||
if (params_->modes[i] == QuickUnlockMode::QUICK_UNLOCK_MODE_PIN &&
|
||||
chromeos::quick_unlock::IsPinDisabledByPolicy(pref_service)) {
|
||||
ash::quick_unlock::IsPinDisabledByPolicy(pref_service)) {
|
||||
return RespondNow(Error(kPinDisabledByPolicy));
|
||||
}
|
||||
}
|
||||
@ -606,13 +606,13 @@ void QuickUnlockPrivateSetModesFunction::OnGetActiveModes(
|
||||
user_manager::User* user =
|
||||
chromeos::ProfileHelper::Get()->GetUserByProfile(profile);
|
||||
if (pin_credential.empty()) {
|
||||
chromeos::quick_unlock::PinBackend::GetInstance()->Remove(
|
||||
ash::quick_unlock::PinBackend::GetInstance()->Remove(
|
||||
user->GetAccountId(), params_->token,
|
||||
base::BindOnce(
|
||||
&QuickUnlockPrivateSetModesFunction::PinRemoveCallComplete,
|
||||
this));
|
||||
} else {
|
||||
chromeos::quick_unlock::PinBackend::GetInstance()->Set(
|
||||
ash::quick_unlock::PinBackend::GetInstance()->Set(
|
||||
user->GetAccountId(), params_->token, pin_credential,
|
||||
base::BindOnce(
|
||||
&QuickUnlockPrivateSetModesFunction::PinSetCallComplete, this));
|
||||
|
@ -37,7 +37,7 @@ AuthTokenValidatorFactory::~AuthTokenValidatorFactory() {}
|
||||
KeyedService* AuthTokenValidatorFactory::BuildServiceInstanceFor(
|
||||
content::BrowserContext* context) const {
|
||||
return new AuthTokenValidatorImpl(
|
||||
chromeos::quick_unlock::QuickUnlockFactory::GetForProfile(
|
||||
quick_unlock::QuickUnlockFactory::GetForProfile(
|
||||
Profile::FromBrowserContext(context)));
|
||||
}
|
||||
|
||||
|
@ -5,15 +5,12 @@
|
||||
#ifndef CHROME_BROWSER_CHROMEOS_MULTIDEVICE_SETUP_AUTH_TOKEN_VALIDATOR_IMPL_H_
|
||||
#define CHROME_BROWSER_CHROMEOS_MULTIDEVICE_SETUP_AUTH_TOKEN_VALIDATOR_IMPL_H_
|
||||
|
||||
// TODO(https://crbug.com/1164001): move to forward declaration.
|
||||
#include "chrome/browser/ash/login/quick_unlock/quick_unlock_storage.h"
|
||||
#include "chromeos/services/multidevice_setup/public/cpp/auth_token_validator.h"
|
||||
#include "components/keyed_service/core/keyed_service.h"
|
||||
|
||||
namespace chromeos {
|
||||
|
||||
namespace quick_unlock {
|
||||
class QuickUnlockStorage;
|
||||
} // namespace quick_unlock
|
||||
|
||||
namespace multidevice_setup {
|
||||
|
||||
// Concrete AuthTokenValidator implementation.
|
||||
|
@ -342,9 +342,9 @@ bool PasswordsPrivateDelegateImpl::OsReauthCall(
|
||||
->GetAccountId());
|
||||
if (user_cannot_manually_enter_password)
|
||||
return true;
|
||||
chromeos::quick_unlock::QuickUnlockStorage* quick_unlock_storage =
|
||||
chromeos::quick_unlock::QuickUnlockFactory::GetForProfile(profile_);
|
||||
const chromeos::quick_unlock::AuthToken* auth_token =
|
||||
ash::quick_unlock::QuickUnlockStorage* quick_unlock_storage =
|
||||
ash::quick_unlock::QuickUnlockFactory::GetForProfile(profile_);
|
||||
const ash::quick_unlock::AuthToken* auth_token =
|
||||
quick_unlock_storage->GetAuthToken();
|
||||
if (!auth_token || !auth_token->GetAge())
|
||||
return false;
|
||||
|
@ -1267,13 +1267,13 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry,
|
||||
chromeos::NetworkMetadataStore::RegisterPrefs(registry);
|
||||
ash::ReleaseNotesStorage::RegisterProfilePrefs(registry);
|
||||
chromeos::HelpAppNotificationController::RegisterProfilePrefs(registry);
|
||||
chromeos::quick_unlock::FingerprintStorage::RegisterProfilePrefs(registry);
|
||||
chromeos::quick_unlock::PinStoragePrefs::RegisterProfilePrefs(registry);
|
||||
ash::quick_unlock::FingerprintStorage::RegisterProfilePrefs(registry);
|
||||
ash::quick_unlock::PinStoragePrefs::RegisterProfilePrefs(registry);
|
||||
chromeos::Preferences::RegisterProfilePrefs(registry);
|
||||
chromeos::EnterprisePrintersProvider::RegisterProfilePrefs(registry);
|
||||
ash::parent_access::ParentAccessService::RegisterProfilePrefs(registry);
|
||||
chromeos::quick_answers::prefs::RegisterProfilePrefs(registry);
|
||||
chromeos::quick_unlock::RegisterProfilePrefs(registry);
|
||||
ash::quick_unlock::RegisterProfilePrefs(registry);
|
||||
chromeos::RegisterSamlProfilePrefs(registry);
|
||||
ash::ScreenTimeController::RegisterProfilePrefs(registry);
|
||||
SecondaryAccountConsentLogger::RegisterPrefs(registry);
|
||||
|
@ -65,8 +65,8 @@ InSessionAuthDialogClient* InSessionAuthDialogClient::Get() {
|
||||
|
||||
bool InSessionAuthDialogClient::IsFingerprintAuthAvailable(
|
||||
const AccountId& account_id) {
|
||||
chromeos::quick_unlock::QuickUnlockStorage* quick_unlock_storage =
|
||||
chromeos::quick_unlock::QuickUnlockFactory::GetForAccountId(account_id);
|
||||
ash::quick_unlock::QuickUnlockStorage* quick_unlock_storage =
|
||||
ash::quick_unlock::QuickUnlockFactory::GetForAccountId(account_id);
|
||||
return quick_unlock_storage &&
|
||||
quick_unlock_storage->fingerprint_storage()->IsFingerprintAvailable();
|
||||
}
|
||||
@ -95,7 +95,7 @@ void InSessionAuthDialogClient::CheckPinAuthAvailability(
|
||||
const AccountId& account_id,
|
||||
base::OnceCallback<void(bool)> callback) {
|
||||
// PinBackend may be using cryptohome backend or prefs backend.
|
||||
chromeos::quick_unlock::PinBackend::GetInstance()->CanAuthenticate(
|
||||
ash::quick_unlock::PinBackend::GetInstance()->CanAuthenticate(
|
||||
account_id, std::move(callback));
|
||||
}
|
||||
|
||||
@ -125,7 +125,7 @@ void InSessionAuthDialogClient::AuthenticateUserWithPasswordOrPin(
|
||||
pending_auth_state_.emplace(std::move(callback));
|
||||
|
||||
if (authenticated_by_pin) {
|
||||
chromeos::quick_unlock::PinBackend::GetInstance()->TryAuthenticate(
|
||||
ash::quick_unlock::PinBackend::GetInstance()->TryAuthenticate(
|
||||
user_context.GetAccountId(), *user_context.GetKey(),
|
||||
base::BindOnce(&InSessionAuthDialogClient::OnPinAttemptDone,
|
||||
weak_factory_.GetWeakPtr(), user_context));
|
||||
@ -142,10 +142,10 @@ void InSessionAuthDialogClient::OnPinAttemptDone(
|
||||
bool success) {
|
||||
if (success) {
|
||||
// Mark strong auth if this is cryptohome based pin.
|
||||
if (chromeos::quick_unlock::PinBackend::GetInstance()->ShouldUseCryptohome(
|
||||
if (ash::quick_unlock::PinBackend::GetInstance()->ShouldUseCryptohome(
|
||||
user_context.GetAccountId())) {
|
||||
chromeos::quick_unlock::QuickUnlockStorage* quick_unlock_storage =
|
||||
chromeos::quick_unlock::QuickUnlockFactory::GetForAccountId(
|
||||
ash::quick_unlock::QuickUnlockStorage* quick_unlock_storage =
|
||||
ash::quick_unlock::QuickUnlockFactory::GetForAccountId(
|
||||
user_context.GetAccountId());
|
||||
if (quick_unlock_storage)
|
||||
quick_unlock_storage->MarkStrongAuth();
|
||||
@ -175,8 +175,8 @@ void InSessionAuthDialogClient::AuthenticateWithPassword(
|
||||
|
||||
void InSessionAuthDialogClient::OnPasswordAuthSuccess(
|
||||
const UserContext& user_context) {
|
||||
chromeos::quick_unlock::QuickUnlockStorage* quick_unlock_storage =
|
||||
chromeos::quick_unlock::QuickUnlockFactory::GetForAccountId(
|
||||
ash::quick_unlock::QuickUnlockStorage* quick_unlock_storage =
|
||||
ash::quick_unlock::QuickUnlockFactory::GetForAccountId(
|
||||
user_context.GetAccountId());
|
||||
if (quick_unlock_storage)
|
||||
quick_unlock_storage->MarkStrongAuth();
|
||||
|
@ -392,7 +392,7 @@ content::WebUIDataSource* CreateOobeUIDataSource(
|
||||
// Configure shared resources
|
||||
AddProductLogoResources(source);
|
||||
|
||||
chromeos::quick_unlock::AddFingerprintResources(source);
|
||||
quick_unlock::AddFingerprintResources(source);
|
||||
AddSyncConsentResources(source);
|
||||
AddArcScreensResources(source);
|
||||
AddAssistantScreensResources(source);
|
||||
|
@ -535,7 +535,7 @@ void MultideviceHandler::NotifySmartLockSignInAllowedChanged() {
|
||||
bool MultideviceHandler::IsAuthTokenValid(const std::string& auth_token) {
|
||||
Profile* profile = Profile::FromWebUI(web_ui());
|
||||
quick_unlock::QuickUnlockStorage* quick_unlock_storage =
|
||||
chromeos::quick_unlock::QuickUnlockFactory::GetForProfile(profile);
|
||||
quick_unlock::QuickUnlockFactory::GetForProfile(profile);
|
||||
return quick_unlock_storage->GetAuthToken() &&
|
||||
auth_token == quick_unlock_storage->GetAuthToken()->Identifier();
|
||||
}
|
||||
|
@ -438,13 +438,11 @@ void AddLockScreenPageStrings(content::WebUIDataSource* html_source,
|
||||
};
|
||||
html_source->AddLocalizedStrings(kLocalizedStrings);
|
||||
|
||||
html_source->AddBoolean("quickUnlockEnabled",
|
||||
chromeos::quick_unlock::IsPinEnabled());
|
||||
html_source->AddBoolean("quickUnlockEnabled", quick_unlock::IsPinEnabled());
|
||||
html_source->AddBoolean("quickUnlockPinAutosubmitFeatureEnabled",
|
||||
chromeos::features::IsPinAutosubmitFeatureEnabled());
|
||||
html_source->AddBoolean(
|
||||
"quickUnlockDisabledByPolicy",
|
||||
chromeos::quick_unlock::IsPinDisabledByPolicy(pref_service));
|
||||
html_source->AddBoolean("quickUnlockDisabledByPolicy",
|
||||
quick_unlock::IsPinDisabledByPolicy(pref_service));
|
||||
html_source->AddBoolean("lockScreenNotificationsEnabled",
|
||||
ash::features::IsLockScreenNotificationsEnabled());
|
||||
html_source->AddBoolean(
|
||||
@ -486,13 +484,13 @@ void AddFingerprintResources(content::WebUIDataSource* html_source,
|
||||
html_source->AddBoolean("fingerprintUnlockEnabled",
|
||||
are_fingerprint_settings_allowed);
|
||||
if (are_fingerprint_settings_allowed) {
|
||||
chromeos::quick_unlock::AddFingerprintResources(html_source);
|
||||
quick_unlock::AddFingerprintResources(html_source);
|
||||
}
|
||||
|
||||
int instruction_id, aria_label_id;
|
||||
bool aria_label_includes_device = false;
|
||||
using FingerprintLocation = chromeos::quick_unlock::FingerprintLocation;
|
||||
switch (chromeos::quick_unlock::GetFingerprintLocation()) {
|
||||
using FingerprintLocation = quick_unlock::FingerprintLocation;
|
||||
switch (quick_unlock::GetFingerprintLocation()) {
|
||||
case FingerprintLocation::TABLET_POWER_BUTTON:
|
||||
instruction_id =
|
||||
IDS_SETTINGS_ADD_FINGERPRINT_DIALOG_INSTRUCTION_LOCATE_SCANNER_POWER_BUTTON;
|
||||
@ -1069,7 +1067,7 @@ void PeopleSection::OnStateChanged(syncer::SyncService* sync_service) {
|
||||
}
|
||||
|
||||
bool PeopleSection::AreFingerprintSettingsAllowed() {
|
||||
return chromeos::quick_unlock::IsFingerprintEnabled(profile());
|
||||
return quick_unlock::IsFingerprintEnabled(profile());
|
||||
}
|
||||
|
||||
void PeopleSection::UpdateRemoveFingerprintSearchTags() {
|
||||
|
@ -360,7 +360,7 @@ void PrivacySection::RegisterHierarchy(HierarchyGenerator* generator) const {
|
||||
}
|
||||
|
||||
bool PrivacySection::AreFingerprintSettingsAllowed() {
|
||||
return chromeos::quick_unlock::IsFingerprintEnabled(profile());
|
||||
return quick_unlock::IsFingerprintEnabled(profile());
|
||||
}
|
||||
|
||||
void PrivacySection::UpdateRemoveFingerprintSearchTags() {
|
||||
|
@ -67,9 +67,9 @@ void QuickUnlockHandler::OnPinLoginAvailable(bool is_available) {
|
||||
}
|
||||
|
||||
void QuickUnlockHandler::UpdateQuickUnlockDisabledByPolicy() {
|
||||
FireWebUIListener("quick-unlock-disabled-by-policy-changed",
|
||||
base::Value(chromeos::quick_unlock::IsPinDisabledByPolicy(
|
||||
pref_service_)));
|
||||
FireWebUIListener(
|
||||
"quick-unlock-disabled-by-policy-changed",
|
||||
base::Value(quick_unlock::IsPinDisabledByPolicy(pref_service_)));
|
||||
}
|
||||
|
||||
} // namespace settings
|
||||
|
@ -24,6 +24,7 @@ extern const char kCryptohomeWildcardLabel[];
|
||||
// source code migration is finished.
|
||||
namespace ash {
|
||||
using ::chromeos::kCryptohomeGaiaKeyLabel;
|
||||
using ::chromeos::kCryptohomePinLabel;
|
||||
}
|
||||
|
||||
#endif // CHROMEOS_LOGIN_AUTH_CRYPTOHOME_KEY_CONSTANTS_H_
|
||||
|
@ -22,7 +22,7 @@ simulate fingerprint enrollment scan progress.
|
||||
|
||||
Fingerprint unlock policy is dependent on device policy and hardware specs.
|
||||
Fingerprint can be manually enabled for testing by calling:
|
||||
chromeos::quick_unlock::EnabledForTesting(true) to force enable fingerprint features.
|
||||
ash::quick_unlock::EnabledForTesting(true) to force enable fingerprint features.
|
||||
|
||||
Fingerprint unlock is not considered strong authentication. This means that,
|
||||
under certain policies, fingerprint cannot be the only method of authentication
|
||||
|
Reference in New Issue
Block a user