OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h" | 5 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_utils.h" |
6 | 6 |
7 #include "base/feature_list.h" | 7 #include "base/feature_list.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 9 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
10 #include "chrome/common/chrome_features.h" | 10 #include "chrome/common/chrome_features.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 pref_service->GetList(prefs::kQuickUnlockModeWhitelist); | 41 pref_service->GetList(prefs::kQuickUnlockModeWhitelist); |
42 base::StringValue all_value(kQuickUnlockWhitelistOptionAll); | 42 base::StringValue all_value(kQuickUnlockWhitelistOptionAll); |
43 base::StringValue pin_value(kQuickUnlockWhitelistOptionPin); | 43 base::StringValue pin_value(kQuickUnlockWhitelistOptionPin); |
44 if (quick_unlock_whitelist->Find(all_value) == | 44 if (quick_unlock_whitelist->Find(all_value) == |
45 quick_unlock_whitelist->end() && | 45 quick_unlock_whitelist->end() && |
46 quick_unlock_whitelist->Find(pin_value) == | 46 quick_unlock_whitelist->Find(pin_value) == |
47 quick_unlock_whitelist->end()) { | 47 quick_unlock_whitelist->end()) { |
48 return false; | 48 return false; |
49 } | 49 } |
50 | 50 |
| 51 // PIN for enterprise is disabled in m56 as it is not fully implemented. |
| 52 if (g_browser_process->platform_part() |
| 53 ->browser_policy_connector_chromeos() |
| 54 ->IsEnterpriseManaged()) |
| 55 return false; |
| 56 |
51 // TODO(jdufault): Disable PIN for supervised users until we allow the owner | 57 // TODO(jdufault): Disable PIN for supervised users until we allow the owner |
52 // to set the PIN. See crbug.com/632797. | 58 // to set the PIN. See crbug.com/632797. |
53 user_manager::User* user = user_manager::UserManager::Get()->GetActiveUser(); | 59 user_manager::User* user = user_manager::UserManager::Get()->GetActiveUser(); |
54 if (user && user->IsSupervised()) | 60 if (user && user->IsSupervised()) |
55 return false; | 61 return false; |
56 | 62 |
57 // Enable quick unlock only if the switch is present. | 63 // Enable quick unlock only if the switch is present. |
58 return base::FeatureList::IsEnabled(features::kQuickUnlockPin); | 64 return base::FeatureList::IsEnabled(features::kQuickUnlockPin); |
59 } | 65 } |
60 | 66 |
61 void EnableQuickUnlockForTesting() { | 67 void EnableQuickUnlockForTesting() { |
62 enable_for_testing_ = true; | 68 enable_for_testing_ = true; |
63 } | 69 } |
64 | 70 |
65 } // namespace chromeos | 71 } // namespace chromeos |
OLD | NEW |