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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 continue; | 157 continue; |
158 } else if (id == PermissionMessage::kMediaGalleriesAllGalleriesCopyTo || | 158 } else if (id == PermissionMessage::kMediaGalleriesAllGalleriesCopyTo || |
159 id == PermissionMessage::kMediaGalleriesAllGalleriesDelete) { | 159 id == PermissionMessage::kMediaGalleriesAllGalleriesDelete) { |
160 // The combined message will be pushed above. | 160 // The combined message will be pushed above. |
161 continue; | 161 continue; |
162 } | 162 } |
163 } | 163 } |
164 if (permissions->HasAPIPermission(APIPermission::kSessions) && | 164 if (permissions->HasAPIPermission(APIPermission::kSessions) && |
165 id == PermissionMessage::kTabs) { | 165 id == PermissionMessage::kTabs) { |
166 message_strings.push_back(l10n_util::GetStringUTF16( | 166 message_strings.push_back(l10n_util::GetStringUTF16( |
167 IDS_EXTENSION_PROMPT_WARNING_TABS_AND_SESSIONS)); | 167 IDS_EXTENSION_PROMPT_WARNING_HISTORY_READ_AND_SESSIONS)); |
168 continue; | 168 continue; |
169 } | 169 } |
170 if (permissions->HasAPIPermission(APIPermission::kSessions) && | 170 if (permissions->HasAPIPermission(APIPermission::kSessions) && |
171 id == PermissionMessage::kBrowsingHistory) { | 171 id == PermissionMessage::kBrowsingHistory) { |
172 message_strings.push_back(l10n_util::GetStringUTF16( | 172 message_strings.push_back(l10n_util::GetStringUTF16( |
173 IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY_AND_SESSIONS)); | 173 IDS_EXTENSION_PROMPT_WARNING_HISTORY_WRITE_AND_SESSIONS)); |
174 continue; | 174 continue; |
175 } | 175 } |
176 | 176 |
177 message_strings.push_back(i->message()); | 177 message_strings.push_back(i->message()); |
178 } | 178 } |
179 | 179 |
180 return message_strings; | 180 return message_strings; |
181 } | 181 } |
182 | 182 |
183 std::vector<base::string16> | 183 std::vector<base::string16> |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
367 std::set<std::string> old_hosts_set( | 367 std::set<std::string> old_hosts_set( |
368 permission_message_util::GetDistinctHosts(old_list, false, false)); | 368 permission_message_util::GetDistinctHosts(old_list, false, false)); |
369 std::set<std::string> new_hosts_only = | 369 std::set<std::string> new_hosts_only = |
370 base::STLSetDifference<std::set<std::string> >(new_hosts_set, | 370 base::STLSetDifference<std::set<std::string> >(new_hosts_set, |
371 old_hosts_set); | 371 old_hosts_set); |
372 | 372 |
373 return !new_hosts_only.empty(); | 373 return !new_hosts_only.empty(); |
374 } | 374 } |
375 | 375 |
376 } // namespace extensions | 376 } // namespace extensions |
OLD | NEW |