OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "components/policy/core/browser/url_blacklist_policy_handler.h" | 5 #include "components/policy/core/browser/url_blacklist_policy_handler.h" |
6 | 6 |
| 7 #include <utility> |
| 8 |
7 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
8 #include "base/prefs/pref_value_map.h" | 10 #include "base/prefs/pref_value_map.h" |
9 #include "base/values.h" | 11 #include "base/values.h" |
10 #include "components/policy/core/browser/policy_error_map.h" | 12 #include "components/policy/core/browser/policy_error_map.h" |
11 #include "components/policy/core/common/policy_map.h" | 13 #include "components/policy/core/common/policy_map.h" |
12 #include "components/policy/core/common/policy_pref_names.h" | 14 #include "components/policy/core/common/policy_pref_names.h" |
13 #include "grit/components_strings.h" | 15 #include "grit/components_strings.h" |
14 #include "policy/policy_constants.h" | 16 #include "policy/policy_constants.h" |
15 | 17 |
16 namespace policy { | 18 namespace policy { |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 | 72 |
71 if (url_blacklist) { | 73 if (url_blacklist) { |
72 for (base::ListValue::const_iterator entry(url_blacklist->begin()); | 74 for (base::ListValue::const_iterator entry(url_blacklist->begin()); |
73 entry != url_blacklist->end(); ++entry) { | 75 entry != url_blacklist->end(); ++entry) { |
74 if ((*entry)->IsType(base::Value::TYPE_STRING)) | 76 if ((*entry)->IsType(base::Value::TYPE_STRING)) |
75 merged_url_blacklist->Append((*entry)->CreateDeepCopy()); | 77 merged_url_blacklist->Append((*entry)->CreateDeepCopy()); |
76 } | 78 } |
77 } | 79 } |
78 | 80 |
79 if (disabled_schemes || url_blacklist) { | 81 if (disabled_schemes || url_blacklist) { |
80 prefs->SetValue(policy_prefs::kUrlBlacklist, merged_url_blacklist.Pass()); | 82 prefs->SetValue(policy_prefs::kUrlBlacklist, |
| 83 std::move(merged_url_blacklist)); |
81 } | 84 } |
82 } | 85 } |
83 | 86 |
84 } // namespace policy | 87 } // namespace policy |
OLD | NEW |