OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_permission_set.h" | 5 #include "chrome/common/extensions/extension_permission_set.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/singleton.h" | 10 #include "base/memory/singleton.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 204 |
205 // Hosted app and private permissions. | 205 // Hosted app and private permissions. |
206 info->RegisterPermission( | 206 info->RegisterPermission( |
207 kChromeAuthPrivate, "chromeAuthPrivate", 0, | 207 kChromeAuthPrivate, "chromeAuthPrivate", 0, |
208 ExtensionPermissionMessage::kNone, kFlagComponentOnly, | 208 ExtensionPermissionMessage::kNone, kFlagComponentOnly, |
209 kTypeAll - kTypePlatformApp); | 209 kTypeAll - kTypePlatformApp); |
210 info->RegisterPermission( | 210 info->RegisterPermission( |
211 kWebstorePrivate, "webstorePrivate", 0, | 211 kWebstorePrivate, "webstorePrivate", 0, |
212 ExtensionPermissionMessage::kNone, kFlagComponentOnly, kTypeAll); | 212 ExtensionPermissionMessage::kNone, kFlagComponentOnly, kTypeAll); |
213 | 213 |
| 214 // Register hosted / packaged app permissions. |
| 215 info->RegisterPermission( |
| 216 kAppNotifications, "appNotifications", 0, |
| 217 ExtensionPermissionMessage::kNone, kFlagSupportsOptional, |
| 218 kTypeHostedApp | kTypePackagedApp); |
| 219 |
214 // Register extension permissions. | 220 // Register extension permissions. |
215 info->RegisterPermission( | 221 info->RegisterPermission( |
216 kBookmark, "bookmarks", IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS, | 222 kBookmark, "bookmarks", IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS, |
217 ExtensionPermissionMessage::kBookmarks, | 223 ExtensionPermissionMessage::kBookmarks, |
218 kFlagSupportsOptional, kTypeDefault); | 224 kFlagSupportsOptional, kTypeDefault); |
219 info->RegisterPermission( | 225 info->RegisterPermission( |
220 kContentSettings, "contentSettings", | 226 kContentSettings, "contentSettings", |
221 IDS_EXTENSION_PROMPT_WARNING_CONTENT_SETTINGS, | 227 IDS_EXTENSION_PROMPT_WARNING_CONTENT_SETTINGS, |
222 ExtensionPermissionMessage::kContentSettings, kFlagNone, kTypeDefault); | 228 ExtensionPermissionMessage::kContentSettings, kFlagNone, kTypeDefault); |
223 info->RegisterPermission( | 229 info->RegisterPermission( |
(...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
847 std::set<std::string> new_hosts_set(GetDistinctHosts(new_list, false, false)); | 853 std::set<std::string> new_hosts_set(GetDistinctHosts(new_list, false, false)); |
848 std::set<std::string> old_hosts_set(GetDistinctHosts(old_list, false, false)); | 854 std::set<std::string> old_hosts_set(GetDistinctHosts(old_list, false, false)); |
849 std::set<std::string> new_hosts_only; | 855 std::set<std::string> new_hosts_only; |
850 | 856 |
851 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(), | 857 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(), |
852 old_hosts_set.begin(), old_hosts_set.end(), | 858 old_hosts_set.begin(), old_hosts_set.end(), |
853 std::inserter(new_hosts_only, new_hosts_only.begin())); | 859 std::inserter(new_hosts_only, new_hosts_only.begin())); |
854 | 860 |
855 return !new_hosts_only.empty(); | 861 return !new_hosts_only.empty(); |
856 } | 862 } |
OLD | NEW |