OLD | NEW |
(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/command_line.h" |
| 8 #include "chrome/browser/browser_process.h" |
| 9 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
| 10 #include "chromeos/chromeos_switches.h" |
| 11 #include "content/public/browser/web_ui_data_source.h" |
| 12 |
| 13 namespace { |
| 14 |
| 15 static bool EnableQuickUnlockSettings() { |
| 16 // Disable quick unlock if the machine is enterprise managed. |
| 17 // TODO(jdufault): This should only be disabled if specified by policy. |
| 18 if (g_browser_process->platform_part() |
| 19 ->browser_policy_connector_chromeos() |
| 20 ->IsEnterpriseManaged()) { |
| 21 return false; |
| 22 } |
| 23 |
| 24 // Enable quick unlock only if the switch is present. |
| 25 return base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 26 chromeos::switches::kEnableQuickUnlockPin); |
| 27 } |
| 28 |
| 29 } // namespace |
| 30 |
| 31 namespace settings { |
| 32 |
| 33 void InitializeQuickUnlockForSettings(content::WebUIDataSource* html_source) { |
| 34 html_source->AddBoolean("quickUnlockAllowed", EnableQuickUnlockSettings()); |
| 35 } |
| 36 |
| 37 } // namespace settings |
OLD | NEW |