| 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 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 RegisterPermission( | 264 RegisterPermission( |
| 265 ExtensionAPIPermission::kWebstorePrivate, "webstorePrivate", 0, | 265 ExtensionAPIPermission::kWebstorePrivate, "webstorePrivate", 0, |
| 266 ExtensionPermissionMessage::kNone, hosted_app | component_only); | 266 ExtensionPermissionMessage::kNone, hosted_app | component_only); |
| 267 | 267 |
| 268 // Extension permissions. | 268 // Extension permissions. |
| 269 RegisterPermission( | 269 RegisterPermission( |
| 270 ExtensionAPIPermission::kBookmark, "bookmarks", | 270 ExtensionAPIPermission::kBookmark, "bookmarks", |
| 271 IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS, | 271 IDS_EXTENSION_PROMPT_WARNING_BOOKMARKS, |
| 272 ExtensionPermissionMessage::kBookmarks, optional); | 272 ExtensionPermissionMessage::kBookmarks, optional); |
| 273 RegisterPermission( | 273 RegisterPermission( |
| 274 ExtensionAPIPermission::kContentSettings, "contentSettings", 0, | 274 ExtensionAPIPermission::kContentSettings, "contentSettings", |
| 275 ExtensionPermissionMessage::kNone, none); | 275 IDS_EXTENSION_PROMPT_WARNING_CONTENT_SETTINGS, |
| 276 ExtensionPermissionMessage::kContentSettings, none); |
| 276 RegisterPermission( | 277 RegisterPermission( |
| 277 ExtensionAPIPermission::kContextMenus, "contextMenus", 0, | 278 ExtensionAPIPermission::kContextMenus, "contextMenus", 0, |
| 278 ExtensionPermissionMessage::kNone, optional); | 279 ExtensionPermissionMessage::kNone, optional); |
| 279 RegisterPermission( | 280 RegisterPermission( |
| 280 ExtensionAPIPermission::kCookie, "cookies", 0, | 281 ExtensionAPIPermission::kCookie, "cookies", 0, |
| 281 ExtensionPermissionMessage::kNone, optional); | 282 ExtensionPermissionMessage::kNone, optional); |
| 282 RegisterPermission( | 283 RegisterPermission( |
| 283 ExtensionAPIPermission::kDebugger, "debugger", | 284 ExtensionAPIPermission::kDebugger, "debugger", |
| 284 IDS_EXTENSION_PROMPT_WARNING_DEBUGGER, | 285 IDS_EXTENSION_PROMPT_WARNING_DEBUGGER, |
| 285 ExtensionPermissionMessage::kDebugger, optional); | 286 ExtensionPermissionMessage::kDebugger, optional); |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 839 std::set<std::string> new_hosts_set(GetDistinctHosts(new_list, false, false)); | 840 std::set<std::string> new_hosts_set(GetDistinctHosts(new_list, false, false)); |
| 840 std::set<std::string> old_hosts_set(GetDistinctHosts(old_list, false, false)); | 841 std::set<std::string> old_hosts_set(GetDistinctHosts(old_list, false, false)); |
| 841 std::set<std::string> new_hosts_only; | 842 std::set<std::string> new_hosts_only; |
| 842 | 843 |
| 843 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(), | 844 std::set_difference(new_hosts_set.begin(), new_hosts_set.end(), |
| 844 old_hosts_set.begin(), old_hosts_set.end(), | 845 old_hosts_set.begin(), old_hosts_set.end(), |
| 845 std::inserter(new_hosts_only, new_hosts_only.begin())); | 846 std::inserter(new_hosts_only, new_hosts_only.begin())); |
| 846 | 847 |
| 847 return !new_hosts_only.empty(); | 848 return !new_hosts_only.empty(); |
| 848 } | 849 } |
| OLD | NEW |