| 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/api_permission.h" | 5 #include "chrome/common/extensions/permissions/api_permission.h" |
| 6 | 6 |
| 7 #include "chrome/common/extensions/permissions/permissions_info.h" | 7 #include "chrome/common/extensions/permissions/permissions_info.h" |
| 8 #include "grit/generated_resources.h" | 8 #include "grit/generated_resources.h" |
| 9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
| 10 | 10 |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 // granted after the user has been shown a file chooser dialog and selected | 167 // granted after the user has been shown a file chooser dialog and selected |
| 168 // a file. Selecting the file is considered consent to read it. | 168 // a file. Selecting the file is considered consent to read it. |
| 169 { kFileSystem, "fileSystem" }, | 169 { kFileSystem, "fileSystem" }, |
| 170 { kFileSystemWrite, "fileSystemWrite", kFlagNone, | 170 { kFileSystemWrite, "fileSystemWrite", kFlagNone, |
| 171 IDS_EXTENSION_PROMPT_WARNING_FILE_SYSTEM_WRITE, | 171 IDS_EXTENSION_PROMPT_WARNING_FILE_SYSTEM_WRITE, |
| 172 PermissionMessage::kFileSystemWrite }, | 172 PermissionMessage::kFileSystemWrite }, |
| 173 { kMediaGalleriesAllGalleries, "mediaGalleriesAllGalleries", | 173 { kMediaGalleriesAllGalleries, "mediaGalleriesAllGalleries", |
| 174 kFlagCannotBeOptional, | 174 kFlagCannotBeOptional, |
| 175 IDS_EXTENSION_PROMPT_WARNING_MEDIA_GALLERIES_ALL_GALLERIES, | 175 IDS_EXTENSION_PROMPT_WARNING_MEDIA_GALLERIES_ALL_GALLERIES, |
| 176 PermissionMessage::kMediaGalleriesAllGalleries }, | 176 PermissionMessage::kMediaGalleriesAllGalleries }, |
| 177 { kPushMessaging, "pushMessaging", kFlagCannotBeOptional }, |
| 177 }; | 178 }; |
| 178 | 179 |
| 179 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(PermissionsToRegister); ++i) { | 180 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(PermissionsToRegister); ++i) { |
| 180 const PermissionRegistration& pr = PermissionsToRegister[i]; | 181 const PermissionRegistration& pr = PermissionsToRegister[i]; |
| 181 info->RegisterPermission( | 182 info->RegisterPermission( |
| 182 pr.id, pr.name, pr.l10n_message_id, | 183 pr.id, pr.name, pr.l10n_message_id, |
| 183 pr.message_id ? pr.message_id : PermissionMessage::kNone, | 184 pr.message_id ? pr.message_id : PermissionMessage::kNone, |
| 184 pr.flags); | 185 pr.flags); |
| 185 } | 186 } |
| 186 | 187 |
| 187 // Register aliases. | 188 // Register aliases. |
| 188 info->RegisterAlias("unlimitedStorage", kOldUnlimitedStoragePermission); | 189 info->RegisterAlias("unlimitedStorage", kOldUnlimitedStoragePermission); |
| 189 info->RegisterAlias("tabs", kWindowsPermission); | 190 info->RegisterAlias("tabs", kWindowsPermission); |
| 190 // TODO(mihaip): Should be removed for the M20 branch, see | 191 // TODO(mihaip): Should be removed for the M20 branch, see |
| 191 // http://crbug.com/120447 for more details. | 192 // http://crbug.com/120447 for more details. |
| 192 info->RegisterAlias("background", kTemporaryBackgroundAlias); | 193 info->RegisterAlias("background", kTemporaryBackgroundAlias); |
| 193 } | 194 } |
| 194 | 195 |
| 195 } // namespace extensions | 196 } // namespace extensions |
| OLD | NEW |