| 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/policy/url_blacklist_policy_handler.h" | 5 #include "chrome/browser/policy/url_blacklist_policy_handler.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/prefs/pref_value_map.h" | 8 #include "base/prefs/pref_value_map.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/common/pref_names.h" | |
| 11 #include "components/policy/core/browser/policy_error_map.h" | 10 #include "components/policy/core/browser/policy_error_map.h" |
| 12 #include "components/policy/core/common/policy_map.h" | 11 #include "components/policy/core/common/policy_map.h" |
| 12 #include "components/policy/core/common/policy_pref_names.h" |
| 13 #include "grit/component_strings.h" | 13 #include "grit/component_strings.h" |
| 14 #include "policy/policy_constants.h" | 14 #include "policy/policy_constants.h" |
| 15 | 15 |
| 16 namespace policy { | 16 namespace policy { |
| 17 | 17 |
| 18 URLBlacklistPolicyHandler::URLBlacklistPolicyHandler() {} | 18 URLBlacklistPolicyHandler::URLBlacklistPolicyHandler() {} |
| 19 | 19 |
| 20 URLBlacklistPolicyHandler::~URLBlacklistPolicyHandler() {} | 20 URLBlacklistPolicyHandler::~URLBlacklistPolicyHandler() {} |
| 21 | 21 |
| 22 bool URLBlacklistPolicyHandler::CheckPolicySettings(const PolicyMap& policies, | 22 bool URLBlacklistPolicyHandler::CheckPolicySettings(const PolicyMap& policies, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 } | 69 } |
| 70 | 70 |
| 71 if (url_blacklist) { | 71 if (url_blacklist) { |
| 72 for (base::ListValue::const_iterator entry(url_blacklist->begin()); | 72 for (base::ListValue::const_iterator entry(url_blacklist->begin()); |
| 73 entry != url_blacklist->end(); ++entry) { | 73 entry != url_blacklist->end(); ++entry) { |
| 74 if ((*entry)->IsType(Value::TYPE_STRING)) | 74 if ((*entry)->IsType(Value::TYPE_STRING)) |
| 75 merged_url_blacklist->Append((*entry)->DeepCopy()); | 75 merged_url_blacklist->Append((*entry)->DeepCopy()); |
| 76 } | 76 } |
| 77 } | 77 } |
| 78 | 78 |
| 79 if (disabled_schemes || url_blacklist) | 79 if (disabled_schemes || url_blacklist) { |
| 80 prefs->SetValue(prefs::kUrlBlacklist, merged_url_blacklist.release()); | 80 prefs->SetValue(policy_prefs::kUrlBlacklist, |
| 81 merged_url_blacklist.release()); |
| 82 } |
| 81 } | 83 } |
| 82 | 84 |
| 83 } // namespace policy | 85 } // namespace policy |
| OLD | NEW |