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/common/extensions/permissions/chrome_permission_message_provide
r.h" | 5 #include "chrome/common/extensions/permissions/chrome_permission_message_provide
r.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
13 #include "chrome/common/extensions/permissions/chrome_permission_message_rules.h
" | 13 #include "chrome/common/extensions/permissions/chrome_permission_message_rules.h
" |
14 #include "chrome/grit/generated_resources.h" | |
15 #include "extensions/common/extensions_client.h" | 14 #include "extensions/common/extensions_client.h" |
16 #include "extensions/common/permissions/permission_message_util.h" | 15 #include "extensions/common/permissions/permission_message_util.h" |
17 #include "extensions/common/permissions/permission_set.h" | 16 #include "extensions/common/permissions/permission_set.h" |
18 #include "extensions/common/url_pattern.h" | 17 #include "extensions/common/url_pattern.h" |
19 #include "extensions/common/url_pattern_set.h" | 18 #include "extensions/common/url_pattern_set.h" |
20 #include "extensions/strings/grit/extensions_strings.h" | |
21 #include "url/gurl.h" | 19 #include "url/gurl.h" |
22 | 20 |
23 namespace extensions { | 21 namespace extensions { |
24 | 22 |
25 namespace { | 23 namespace { |
26 | 24 |
27 // Copyable wrapper to make PermissionMessages comparable. | 25 // Copyable wrapper to make PermissionMessages comparable. |
28 class ComparablePermission { | 26 class ComparablePermission { |
29 public: | 27 public: |
30 explicit ComparablePermission(const PermissionMessage& msg) : msg_(&msg) {} | 28 explicit ComparablePermission(const PermissionMessage& msg) : msg_(&msg) {} |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 std::set<std::string> old_hosts_set( | 242 std::set<std::string> old_hosts_set( |
245 permission_message_util::GetDistinctHosts(old_list, false, false)); | 243 permission_message_util::GetDistinctHosts(old_list, false, false)); |
246 std::set<std::string> new_hosts_only = | 244 std::set<std::string> new_hosts_only = |
247 base::STLSetDifference<std::set<std::string> >(new_hosts_set, | 245 base::STLSetDifference<std::set<std::string> >(new_hosts_set, |
248 old_hosts_set); | 246 old_hosts_set); |
249 | 247 |
250 return !new_hosts_only.empty(); | 248 return !new_hosts_only.empty(); |
251 } | 249 } |
252 | 250 |
253 } // namespace extensions | 251 } // namespace extensions |
OLD | NEW |