OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/login_profile_policy_provider.h" | 5 #include "chrome/browser/chromeos/policy/login_profile_policy_provider.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 16 matching lines...) Expand all Loading... |
27 const char kUserActivityScreenDimDelayScale[] = | 27 const char kUserActivityScreenDimDelayScale[] = |
28 "UserActivityScreenDimDelayScale"; | 28 "UserActivityScreenDimDelayScale"; |
29 | 29 |
30 const char kActionSuspend[] = "Suspend"; | 30 const char kActionSuspend[] = "Suspend"; |
31 const char kActionLogout[] = "Logout"; | 31 const char kActionLogout[] = "Logout"; |
32 const char kActionShutdown[] = "Shutdown"; | 32 const char kActionShutdown[] = "Shutdown"; |
33 const char kActionDoNothing[] = "DoNothing"; | 33 const char kActionDoNothing[] = "DoNothing"; |
34 | 34 |
35 std::unique_ptr<base::Value> GetAction(const std::string& action) { | 35 std::unique_ptr<base::Value> GetAction(const std::string& action) { |
36 if (action == kActionSuspend) { | 36 if (action == kActionSuspend) { |
37 return std::unique_ptr<base::Value>(new base::FundamentalValue( | 37 return std::unique_ptr<base::Value>( |
38 chromeos::PowerPolicyController::ACTION_SUSPEND)); | 38 new base::Value(chromeos::PowerPolicyController::ACTION_SUSPEND)); |
39 } | 39 } |
40 if (action == kActionLogout) { | 40 if (action == kActionLogout) { |
41 return std::unique_ptr<base::Value>(new base::FundamentalValue( | 41 return std::unique_ptr<base::Value>( |
42 chromeos::PowerPolicyController::ACTION_STOP_SESSION)); | 42 new base::Value(chromeos::PowerPolicyController::ACTION_STOP_SESSION)); |
43 } | 43 } |
44 if (action == kActionShutdown) { | 44 if (action == kActionShutdown) { |
45 return std::unique_ptr<base::Value>(new base::FundamentalValue( | 45 return std::unique_ptr<base::Value>( |
46 chromeos::PowerPolicyController::ACTION_SHUT_DOWN)); | 46 new base::Value(chromeos::PowerPolicyController::ACTION_SHUT_DOWN)); |
47 } | 47 } |
48 if (action == kActionDoNothing) { | 48 if (action == kActionDoNothing) { |
49 return std::unique_ptr<base::Value>(new base::FundamentalValue( | 49 return std::unique_ptr<base::Value>( |
50 chromeos::PowerPolicyController::ACTION_DO_NOTHING)); | 50 new base::Value(chromeos::PowerPolicyController::ACTION_DO_NOTHING)); |
51 } | 51 } |
52 return std::unique_ptr<base::Value>(); | 52 return std::unique_ptr<base::Value>(); |
53 } | 53 } |
54 | 54 |
55 | 55 |
56 // Applies the value of |device_policy| in |device_policy_map| as the | 56 // Applies the value of |device_policy| in |device_policy_map| as the |
57 // recommended value of |user_policy| in |user_policy_map|. If the value of | 57 // recommended value of |user_policy| in |user_policy_map|. If the value of |
58 // |device_policy| is unset, does nothing. | 58 // |device_policy| is unset, does nothing. |
59 void ApplyDevicePolicyAsRecommendedPolicy(const std::string& device_policy, | 59 void ApplyDevicePolicyAsRecommendedPolicy(const std::string& device_policy, |
60 const std::string& user_policy, | 60 const std::string& user_policy, |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 ApplyValueAsMandatoryPolicy(policy_value.get(), | 193 ApplyValueAsMandatoryPolicy(policy_value.get(), |
194 key::kPowerManagementIdleSettings, | 194 key::kPowerManagementIdleSettings, |
195 &user_policy_map); | 195 &user_policy_map); |
196 } | 196 } |
197 } | 197 } |
198 | 198 |
199 UpdatePolicy(std::move(bundle)); | 199 UpdatePolicy(std::move(bundle)); |
200 } | 200 } |
201 | 201 |
202 } // namespace policy | 202 } // namespace policy |
OLD | NEW |