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( | |
96 messages, PermissionMessage::kHostsAll, PermissionMessage::kTabs); | |
jww
2014/06/07 19:33:07
Please format in the same way as the previous line
| |
97 | |
93 return messages; | 98 return messages; |
94 } | 99 } |
95 | 100 |
96 std::vector<base::string16> ChromePermissionMessageProvider::GetWarningMessages( | 101 std::vector<base::string16> ChromePermissionMessageProvider::GetWarningMessages( |
97 const PermissionSet* permissions, | 102 const PermissionSet* permissions, |
98 Manifest::Type extension_type) const { | 103 Manifest::Type extension_type) const { |
99 std::vector<base::string16> message_strings; | 104 std::vector<base::string16> message_strings; |
100 PermissionMessages messages = | 105 PermissionMessages messages = |
101 GetPermissionMessages(permissions, extension_type); | 106 GetPermissionMessages(permissions, extension_type); |
102 | 107 |
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
349 std::set<std::string> old_hosts_set( | 354 std::set<std::string> old_hosts_set( |
350 permission_message_util::GetDistinctHosts(old_list, false, false)); | 355 permission_message_util::GetDistinctHosts(old_list, false, false)); |
351 std::set<std::string> new_hosts_only = | 356 std::set<std::string> new_hosts_only = |
352 base::STLSetDifference<std::set<std::string> >(new_hosts_set, | 357 base::STLSetDifference<std::set<std::string> >(new_hosts_set, |
353 old_hosts_set); | 358 old_hosts_set); |
354 | 359 |
355 return !new_hosts_only.empty(); | 360 return !new_hosts_only.empty(); |
356 } | 361 } |
357 | 362 |
358 } // namespace extensions | 363 } // namespace extensions |
OLD | NEW |