Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(384)

Side by Side Diff: chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.cc

Issue 2150763002: Enable PIN configuration settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Fix tests Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h"
6
7 #include "base/feature_list.h"
8 #include "chrome/browser/browser_process.h"
9 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
10 #include "chrome/common/chrome_features.h"
11
12 namespace chromeos {
13
14 namespace {
15 bool enable_for_testing_ = false;
16 } // namespace
17
18 bool IsQuickUnlockEnabled() {
19 if (enable_for_testing_)
20 return true;
21
22 // TODO(jdufault): Implement a proper policy check. For now, just disable if
23 // the device is enterprise enrolled. See crbug.com/612271.
24 if (g_browser_process->platform_part()
25 ->browser_policy_connector_chromeos()
26 ->IsEnterpriseManaged()) {
27 return false;
28 }
29
30 // Enable quick unlock only if the switch is present.
31 return base::FeatureList::IsEnabled(features::kQuickUnlockPin);
32 }
33
34 void EnableQuickUnlockForTesting() {
35 enable_for_testing_ = true;
36 }
37
38 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698