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 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 IDS_EXTENSION_PROMPT_WARNING_MEDIA_GALLERIES_READ_WRITE : | 148 IDS_EXTENSION_PROMPT_WARNING_MEDIA_GALLERIES_READ_WRITE : |
149 IDS_EXTENSION_PROMPT_WARNING_MEDIA_GALLERIES_READ_DELETE; | 149 IDS_EXTENSION_PROMPT_WARNING_MEDIA_GALLERIES_READ_DELETE; |
150 message_strings.push_back(l10n_util::GetStringUTF16(m_id)); | 150 message_strings.push_back(l10n_util::GetStringUTF16(m_id)); |
151 continue; | 151 continue; |
152 } else if (id == PermissionMessage::kMediaGalleriesAllGalleriesCopyTo || | 152 } else if (id == PermissionMessage::kMediaGalleriesAllGalleriesCopyTo || |
153 id == PermissionMessage::kMediaGalleriesAllGalleriesDelete) { | 153 id == PermissionMessage::kMediaGalleriesAllGalleriesDelete) { |
154 // The combined message will be pushed above. | 154 // The combined message will be pushed above. |
155 continue; | 155 continue; |
156 } | 156 } |
157 } | 157 } |
| 158 if (permissions->HasAPIPermission(APIPermission::kSessions) && |
| 159 id == PermissionMessage::kTabs) { |
| 160 message_strings.push_back(l10n_util::GetStringUTF16( |
| 161 IDS_EXTENSION_PROMPT_WARNING_TABS_AND_SESSIONS)); |
| 162 continue; |
| 163 } |
| 164 if (permissions->HasAPIPermission(APIPermission::kSessions) && |
| 165 id == PermissionMessage::kBrowsingHistory) { |
| 166 message_strings.push_back(l10n_util::GetStringUTF16( |
| 167 IDS_EXTENSION_PROMPT_WARNING_BROWSING_HISTORY_AND_SESSIONS)); |
| 168 continue; |
| 169 } |
158 | 170 |
159 message_strings.push_back(i->message()); | 171 message_strings.push_back(i->message()); |
160 } | 172 } |
161 | 173 |
162 return message_strings; | 174 return message_strings; |
163 } | 175 } |
164 | 176 |
165 std::vector<base::string16> | 177 std::vector<base::string16> |
166 ChromePermissionMessageProvider::GetWarningMessagesDetails( | 178 ChromePermissionMessageProvider::GetWarningMessagesDetails( |
167 const PermissionSet* permissions, | 179 const PermissionSet* permissions, |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 std::set<std::string> old_hosts_set( | 361 std::set<std::string> old_hosts_set( |
350 permission_message_util::GetDistinctHosts(old_list, false, false)); | 362 permission_message_util::GetDistinctHosts(old_list, false, false)); |
351 std::set<std::string> new_hosts_only = | 363 std::set<std::string> new_hosts_only = |
352 base::STLSetDifference<std::set<std::string> >(new_hosts_set, | 364 base::STLSetDifference<std::set<std::string> >(new_hosts_set, |
353 old_hosts_set); | 365 old_hosts_set); |
354 | 366 |
355 return !new_hosts_only.empty(); | 367 return !new_hosts_only.empty(); |
356 } | 368 } |
357 | 369 |
358 } // namespace extensions | 370 } // namespace extensions |
OLD | NEW |