| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/permissions_info.h" | 5 #include "chrome/common/extensions/permissions/permissions_info.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace extensions { | 9 namespace extensions { |
| 10 | 10 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 DCHECK(name_map_.find(name) != name_map_.end()); | 61 DCHECK(name_map_.find(name) != name_map_.end()); |
| 62 DCHECK(name_map_.find(alias) == name_map_.end()); | 62 DCHECK(name_map_.find(alias) == name_map_.end()); |
| 63 name_map_[alias] = name_map_[name]; | 63 name_map_[alias] = name_map_[name]; |
| 64 } | 64 } |
| 65 | 65 |
| 66 APIPermission* PermissionsInfo::RegisterPermission( | 66 APIPermission* PermissionsInfo::RegisterPermission( |
| 67 APIPermission::ID id, | 67 APIPermission::ID id, |
| 68 const char* name, | 68 const char* name, |
| 69 int l10n_message_id, | 69 int l10n_message_id, |
| 70 PermissionMessage::ID message_id, | 70 PermissionMessage::ID message_id, |
| 71 int flags) { | 71 int flags, |
| 72 const APIPermission::DetailConstructor &detail_constructor) { |
| 72 DCHECK(id_map_.find(id) == id_map_.end()); | 73 DCHECK(id_map_.find(id) == id_map_.end()); |
| 73 DCHECK(name_map_.find(name) == name_map_.end()); | 74 DCHECK(name_map_.find(name) == name_map_.end()); |
| 74 | 75 |
| 75 APIPermission* permission = new APIPermission( | 76 APIPermission* permission = new APIPermission( |
| 76 id, name, l10n_message_id, message_id, flags); | 77 id, name, l10n_message_id, message_id, flags, detail_constructor); |
| 77 | 78 |
| 78 id_map_[id] = permission; | 79 id_map_[id] = permission; |
| 79 name_map_[name] = permission; | 80 name_map_[name] = permission; |
| 80 | 81 |
| 81 permission_count_++; | 82 permission_count_++; |
| 82 | 83 |
| 83 return permission; | 84 return permission; |
| 84 } | 85 } |
| 85 | 86 |
| 86 } // namespace extensions | 87 } // namespace extensions |
| OLD | NEW |