| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/common/extensions/extension_permission_set.h" | 5 #include "chrome/common/extensions/extension_permission_set.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "base/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
| 13 #include "base/utf_string_conversions.h" | 13 #include "base/utf_string_conversions.h" |
| 14 #include "chrome/common/extensions/extension.h" | 14 #include "chrome/common/extensions/extension.h" |
| 15 #include "chrome/common/extensions/extension_constants.h" | 15 #include "chrome/common/extensions/extension_constants.h" |
| 16 #include "chrome/common/extensions/extension_l10n_util.h" | 16 #include "chrome/common/extensions/extension_l10n_util.h" |
| 17 #include "chrome/common/extensions/url_pattern.h" | 17 #include "chrome/common/extensions/url_pattern.h" |
| 18 #include "chrome/common/extensions/url_pattern_set.h" | 18 #include "chrome/common/extensions/url_pattern_set.h" |
| 19 #include "content/common/url_constants.h" | 19 #include "content/public/common/url_constants.h" |
| 20 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
| 21 #include "net/base/registry_controlled_domain.h" | 21 #include "net/base/registry_controlled_domain.h" |
| 22 #include "ui/base/l10n/l10n_util.h" | 22 #include "ui/base/l10n/l10n_util.h" |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 // Helper for GetDistinctHosts(): com > net > org > everything else. | 26 // Helper for GetDistinctHosts(): com > net > org > everything else. |
| 27 bool RcdBetterThan(std::string a, std::string b) { | 27 bool RcdBetterThan(std::string a, std::string b) { |
| 28 if (a == b) | 28 if (a == b) |
| 29 return false; | 29 return false; |
| (...skipping 810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 std::set<std::string> new_hosts_set(GetDistinctHosts(new_list, false, false)); | 840 std::set<std::string> new_hosts_set(GetDistinctHosts(new_list, false, false)); |
| 841 std::set<std::string> old_hosts_set(GetDistinctHosts(old_list, false, false)); | 841 std::set<std::string> old_hosts_set(GetDistinctHosts(old_list, false, false)); |
| 842 std::set<std::string> new_hosts_only; | 842 std::set<std::string> new_hosts_only; |
| 843 | 843 |
| 844 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(), | 844 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(), |
| 845 old_hosts_set.begin(), old_hosts_set.end(), | 845 old_hosts_set.begin(), old_hosts_set.end(), |
| 846 std::inserter(new_hosts_only, new_hosts_only.begin())); | 846 std::inserter(new_hosts_only, new_hosts_only.begin())); |
| 847 | 847 |
| 848 return !new_hosts_only.empty(); | 848 return !new_hosts_only.empty(); |
| 849 } | 849 } |
| OLD | NEW |