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/policy/default_geolocation_policy_handler.h" |
| 6 #include "chrome/common/pref_names.h" |
| 7 #include "components/policy/core/common/policy_map.h" |
| 8 #include "components/prefs/pref_value_map.h" |
| 9 #include "policy/policy_constants.h" |
| 10 |
| 11 namespace policy { |
| 12 |
| 13 #if defined(OS_CHROMEOS) |
| 14 DefaultGeolocationPolicyHandler::DefaultGeolocationPolicyHandler() |
| 15 : IntRangePolicyHandlerBase(key::kDefaultGeolocationSetting, 1, 3, false) {} |
| 16 |
| 17 DefaultGeolocationPolicyHandler::~DefaultGeolocationPolicyHandler() {} |
| 18 |
| 19 void DefaultGeolocationPolicyHandler::ApplyPolicySettings( |
| 20 const PolicyMap& policies, PrefValueMap* prefs) { |
| 21 const base::Value* value = policies.GetValue(policy_name()); |
| 22 int value_in_range; |
| 23 if (value && EnsureInRange(value, &value_in_range, NULL) |
| 24 && value_in_range == 2) { // 2 = BlockGeolocation |
| 25 prefs->SetBoolean(prefs::kArcLocationServiceEnabled, false); |
| 26 } |
| 27 } |
| 28 #endif |
| 29 |
| 30 } // namespace policy |
OLD | NEW |