OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/policy/device_local_account_policy_provider.h" | 5 #include "chrome/browser/chromeos/policy/device_local_account_policy_provider.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 std::unique_ptr<PolicyMap> chrome_policy_overrides; | 55 std::unique_ptr<PolicyMap> chrome_policy_overrides; |
56 if (type == DeviceLocalAccount::TYPE_PUBLIC_SESSION) { | 56 if (type == DeviceLocalAccount::TYPE_PUBLIC_SESSION) { |
57 chrome_policy_overrides.reset(new PolicyMap()); | 57 chrome_policy_overrides.reset(new PolicyMap()); |
58 | 58 |
59 // Exit the session when the lid is closed. The default behavior is to | 59 // Exit the session when the lid is closed. The default behavior is to |
60 // suspend while leaving the session running, which is not desirable for | 60 // suspend while leaving the session running, which is not desirable for |
61 // public sessions. | 61 // public sessions. |
62 chrome_policy_overrides->Set( | 62 chrome_policy_overrides->Set( |
63 key::kLidCloseAction, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, | 63 key::kLidCloseAction, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, |
64 POLICY_SOURCE_PUBLIC_SESSION_OVERRIDE, | 64 POLICY_SOURCE_PUBLIC_SESSION_OVERRIDE, |
65 base::MakeUnique<base::FundamentalValue>( | 65 base::MakeUnique<base::Value>( |
66 chromeos::PowerPolicyController::ACTION_STOP_SESSION), | 66 chromeos::PowerPolicyController::ACTION_STOP_SESSION), |
67 nullptr); | 67 nullptr); |
68 // Force the |ShelfAutoHideBehavior| policy to |Never|, ensuring that the | 68 // Force the |ShelfAutoHideBehavior| policy to |Never|, ensuring that the |
69 // ash shelf does not auto-hide. | 69 // ash shelf does not auto-hide. |
70 chrome_policy_overrides->Set( | 70 chrome_policy_overrides->Set( |
71 key::kShelfAutoHideBehavior, POLICY_LEVEL_MANDATORY, | 71 key::kShelfAutoHideBehavior, POLICY_LEVEL_MANDATORY, |
72 POLICY_SCOPE_MACHINE, POLICY_SOURCE_PUBLIC_SESSION_OVERRIDE, | 72 POLICY_SCOPE_MACHINE, POLICY_SOURCE_PUBLIC_SESSION_OVERRIDE, |
73 base::MakeUnique<base::StringValue>("Never"), nullptr); | 73 base::MakeUnique<base::StringValue>("Never"), nullptr); |
74 // Force the |ShowLogoutButtonInTray| policy to |true|, ensuring that a big, | 74 // Force the |ShowLogoutButtonInTray| policy to |true|, ensuring that a big, |
75 // red logout button is shown in the ash system tray. | 75 // red logout button is shown in the ash system tray. |
76 chrome_policy_overrides->Set( | 76 chrome_policy_overrides->Set(key::kShowLogoutButtonInTray, |
77 key::kShowLogoutButtonInTray, POLICY_LEVEL_MANDATORY, | 77 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, |
78 POLICY_SCOPE_MACHINE, POLICY_SOURCE_PUBLIC_SESSION_OVERRIDE, | 78 POLICY_SOURCE_PUBLIC_SESSION_OVERRIDE, |
79 base::MakeUnique<base::FundamentalValue>(true), nullptr); | 79 base::MakeUnique<base::Value>(true), nullptr); |
80 // Force the |FullscreenAllowed| policy to |false|, ensuring that the ash | 80 // Force the |FullscreenAllowed| policy to |false|, ensuring that the ash |
81 // shelf cannot be hidden by entering fullscreen mode. | 81 // shelf cannot be hidden by entering fullscreen mode. |
82 chrome_policy_overrides->Set( | 82 chrome_policy_overrides->Set(key::kFullscreenAllowed, |
83 key::kFullscreenAllowed, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, | 83 POLICY_LEVEL_MANDATORY, POLICY_SCOPE_MACHINE, |
84 POLICY_SOURCE_PUBLIC_SESSION_OVERRIDE, | 84 POLICY_SOURCE_PUBLIC_SESSION_OVERRIDE, |
85 base::MakeUnique<base::FundamentalValue>(false), nullptr); | 85 base::MakeUnique<base::Value>(false), nullptr); |
86 } | 86 } |
87 | 87 |
88 std::unique_ptr<DeviceLocalAccountPolicyProvider> provider( | 88 std::unique_ptr<DeviceLocalAccountPolicyProvider> provider( |
89 new DeviceLocalAccountPolicyProvider(user_id, | 89 new DeviceLocalAccountPolicyProvider(user_id, |
90 device_local_account_policy_service, | 90 device_local_account_policy_service, |
91 std::move(chrome_policy_overrides))); | 91 std::move(chrome_policy_overrides))); |
92 return provider; | 92 return provider; |
93 } | 93 } |
94 | 94 |
95 bool DeviceLocalAccountPolicyProvider::IsInitializationComplete( | 95 bool DeviceLocalAccountPolicyProvider::IsInitializationComplete( |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 const PolicyMap::Entry& entry = policy_override.second; | 167 const PolicyMap::Entry& entry = policy_override.second; |
168 chrome_policy.Set(policy_override.first, entry.level, entry.scope, | 168 chrome_policy.Set(policy_override.first, entry.level, entry.scope, |
169 entry.source, entry.value->CreateDeepCopy(), nullptr); | 169 entry.source, entry.value->CreateDeepCopy(), nullptr); |
170 } | 170 } |
171 } | 171 } |
172 | 172 |
173 UpdatePolicy(std::move(bundle)); | 173 UpdatePolicy(std::move(bundle)); |
174 } | 174 } |
175 | 175 |
176 } // namespace policy | 176 } // namespace policy |
OLD | NEW |