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

Side by Side Diff: chrome/browser/ui/webui/settings/chromeos/quick_unlock_handler.cc

Issue 2150763002: Enable PIN configuration settings. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Rebase 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/ui/webui/settings/chromeos/quick_unlock_handler.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 #include "chromeos/chromeos_switches.h"
12 #include "content/public/browser/web_ui_data_source.h"
13
14 namespace {
15
16 static bool IsQuickUnlockAllowed() {
17 // Disable quick unlock if the machine is enterprise managed.
18 // TODO(jdufault): This should only be disabled if specified by policy.
19 if (g_browser_process->platform_part()
20 ->browser_policy_connector_chromeos()
21 ->IsEnterpriseManaged()) {
22 return false;
23 }
24
25 // Enable quick unlock only if the switch is present.
26 return base::FeatureList::IsEnabled(features::kQuickUnlockPin);
27 }
28
29 } // namespace
30
31 namespace settings {
32
33 void InitializeQuickUnlockForSettings(content::WebUIDataSource* html_source) {
34 html_source->AddBoolean("quickUnlockAllowed", IsQuickUnlockAllowed());
Dan Beam 2016/07/22 01:22:28 why is it better to have this key ("quickUnlockAll
jdufault 2016/07/22 19:15:50 I've inlined the html_source->AddBoolean into md_s
35 }
36
37 } // namespace settings
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698