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 "base/stl_util.h" | 7 #include "base/stl_util.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "extensions/common/extensions_client.h" | 9 #include "extensions/common/extensions_client.h" |
10 #include "extensions/common/permissions/permission_message.h" | 10 #include "extensions/common/permissions/permission_message.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 SuppressMessage(messages, | 83 SuppressMessage(messages, |
84 PermissionMessage::kTabs, | 84 PermissionMessage::kTabs, |
85 PermissionMessage::kFavicon); | 85 PermissionMessage::kFavicon); |
86 SuppressMessage(messages, | 86 SuppressMessage(messages, |
87 PermissionMessage::kBrowsingHistory, | 87 PermissionMessage::kBrowsingHistory, |
88 PermissionMessage::kFavicon); | 88 PermissionMessage::kFavicon); |
89 // Warning for history permission already covers warning for tabs permission. | 89 // Warning for history permission already covers warning for tabs permission. |
90 SuppressMessage(messages, | 90 SuppressMessage(messages, |
91 PermissionMessage::kBrowsingHistory, | 91 PermissionMessage::kBrowsingHistory, |
92 PermissionMessage::kTabs); | 92 PermissionMessage::kTabs); |
| 93 // Warning for full access permission already covers warning for tabs |
| 94 // permission. |
| 95 SuppressMessage(messages, |
| 96 PermissionMessage::kHostsAll, |
| 97 PermissionMessage::kTabs); |
| 98 |
93 return messages; | 99 return messages; |
94 } | 100 } |
95 | 101 |
96 std::vector<base::string16> ChromePermissionMessageProvider::GetWarningMessages( | 102 std::vector<base::string16> ChromePermissionMessageProvider::GetWarningMessages( |
97 const PermissionSet* permissions, | 103 const PermissionSet* permissions, |
98 Manifest::Type extension_type) const { | 104 Manifest::Type extension_type) const { |
99 std::vector<base::string16> message_strings; | 105 std::vector<base::string16> message_strings; |
100 PermissionMessages messages = | 106 PermissionMessages messages = |
101 GetPermissionMessages(permissions, extension_type); | 107 GetPermissionMessages(permissions, extension_type); |
102 | 108 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 std::set<std::string> old_hosts_set( | 355 std::set<std::string> old_hosts_set( |
350 permission_message_util::GetDistinctHosts(old_list, false, false)); | 356 permission_message_util::GetDistinctHosts(old_list, false, false)); |
351 std::set<std::string> new_hosts_only = | 357 std::set<std::string> new_hosts_only = |
352 base::STLSetDifference<std::set<std::string> >(new_hosts_set, | 358 base::STLSetDifference<std::set<std::string> >(new_hosts_set, |
353 old_hosts_set); | 359 old_hosts_set); |
354 | 360 |
355 return !new_hosts_only.empty(); | 361 return !new_hosts_only.empty(); |
356 } | 362 } |
357 | 363 |
358 } // namespace extensions | 364 } // namespace extensions |
OLD | NEW |