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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/settings/chromeos/quick_unlock_handler.cc
diff --git a/chrome/browser/ui/webui/settings/chromeos/quick_unlock_handler.cc b/chrome/browser/ui/webui/settings/chromeos/quick_unlock_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..d0796d901fe51c80706eec63e43d7b5ba491cd61
--- /dev/null
+++ b/chrome/browser/ui/webui/settings/chromeos/quick_unlock_handler.cc
@@ -0,0 +1,37 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/settings/chromeos/quick_unlock_handler.h"
+
+#include "base/feature_list.h"
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
+#include "chrome/common/chrome_features.h"
+#include "chromeos/chromeos_switches.h"
+#include "content/public/browser/web_ui_data_source.h"
+
+namespace {
+
+static bool IsQuickUnlockAllowed() {
+ // Disable quick unlock if the machine is enterprise managed.
+ // TODO(jdufault): This should only be disabled if specified by policy.
+ if (g_browser_process->platform_part()
+ ->browser_policy_connector_chromeos()
+ ->IsEnterpriseManaged()) {
+ return false;
+ }
+
+ // Enable quick unlock only if the switch is present.
+ return base::FeatureList::IsEnabled(features::kQuickUnlockPin);
+}
+
+} // namespace
+
+namespace settings {
+
+void InitializeQuickUnlockForSettings(content::WebUIDataSource* html_source) {
+ 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
+}
+
+} // namespace settings

Powered by Google App Engine
This is Rietveld 408576698