| 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/bluetooth_device_permission.h" | 7 #include "chrome/common/extensions/permissions/bluetooth_device_permission.h" |
| 8 #include "chrome/common/extensions/permissions/media_galleries_permission.h" | 8 #include "chrome/common/extensions/permissions/media_galleries_permission.h" |
| 9 #include "chrome/common/extensions/permissions/permissions_info.h" | 9 #include "chrome/common/extensions/permissions/permissions_info.h" |
| 10 #include "chrome/common/extensions/permissions/socket_permission.h" | 10 #include "chrome/common/extensions/permissions/socket_permission.h" |
| (...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 &::CreateAPIPermission<BluetoothDevicePermission> }, | 342 &::CreateAPIPermission<BluetoothDevicePermission> }, |
| 343 { APIPermission::kUsb, "usb", kFlagNone, | 343 { APIPermission::kUsb, "usb", kFlagNone, |
| 344 IDS_EXTENSION_PROMPT_WARNING_USB, | 344 IDS_EXTENSION_PROMPT_WARNING_USB, |
| 345 PermissionMessage::kUsb }, | 345 PermissionMessage::kUsb }, |
| 346 { APIPermission::kUsbDevice, "usbDevices", | 346 { APIPermission::kUsbDevice, "usbDevices", |
| 347 kFlagMustBeOptional, 0, PermissionMessage::kNone, | 347 kFlagMustBeOptional, 0, PermissionMessage::kNone, |
| 348 &::CreateAPIPermission<UsbDevicePermission> }, | 348 &::CreateAPIPermission<UsbDevicePermission> }, |
| 349 { APIPermission::kSystemIndicator, "systemIndicator", kFlagNone, | 349 { APIPermission::kSystemIndicator, "systemIndicator", kFlagNone, |
| 350 IDS_EXTENSION_PROMPT_WARNING_SYSTEM_INDICATOR, | 350 IDS_EXTENSION_PROMPT_WARNING_SYSTEM_INDICATOR, |
| 351 PermissionMessage::kSystemIndicator }, | 351 PermissionMessage::kSystemIndicator }, |
| 352 { APIPermission::kSystemInfoDisplay, "systemInfo.display" }, |
| 352 { APIPermission::kPointerLock, "pointerLock" }, | 353 { APIPermission::kPointerLock, "pointerLock" }, |
| 353 }; | 354 }; |
| 354 | 355 |
| 355 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(PermissionsToRegister); ++i) { | 356 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(PermissionsToRegister); ++i) { |
| 356 const PermissionRegistration& pr = PermissionsToRegister[i]; | 357 const PermissionRegistration& pr = PermissionsToRegister[i]; |
| 357 info->RegisterPermission( | 358 info->RegisterPermission( |
| 358 pr.id, pr.name, pr.l10n_message_id, | 359 pr.id, pr.name, pr.l10n_message_id, |
| 359 pr.message_id ? pr.message_id : PermissionMessage::kNone, | 360 pr.message_id ? pr.message_id : PermissionMessage::kNone, |
| 360 pr.flags, | 361 pr.flags, |
| 361 pr.constructor); | 362 pr.constructor); |
| 362 } | 363 } |
| 363 | 364 |
| 364 // Register aliases. | 365 // Register aliases. |
| 365 info->RegisterAlias("unlimitedStorage", kOldUnlimitedStoragePermission); | 366 info->RegisterAlias("unlimitedStorage", kOldUnlimitedStoragePermission); |
| 366 info->RegisterAlias("tabs", kWindowsPermission); | 367 info->RegisterAlias("tabs", kWindowsPermission); |
| 367 } | 368 } |
| 368 | 369 |
| 369 } // namespace extensions | 370 } // namespace extensions |
| OLD | NEW |