| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/common/permissions/usb_device_permission.h" | 5 #include "extensions/common/permissions/usb_device_permission.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 base::UTF8ToUTF16(vendor))); | 110 base::UTF8ToUTF16(vendor))); |
| 111 } | 111 } |
| 112 | 112 |
| 113 // Display the catch all "device from an unknown vendor" last. | 113 // Display the catch all "device from an unknown vendor" last. |
| 114 if (found_unknown_vendor) { | 114 if (found_unknown_vendor) { |
| 115 details.push_back(l10n_util::GetStringUTF16( | 115 details.push_back(l10n_util::GetStringUTF16( |
| 116 IDS_EXTENSION_PROMPT_WARNING_USB_DEVICE_LIST_ITEM_UNKNOWN_VENDOR)); | 116 IDS_EXTENSION_PROMPT_WARNING_USB_DEVICE_LIST_ITEM_UNKNOWN_VENDOR)); |
| 117 } | 117 } |
| 118 | 118 |
| 119 if (messages) { | 119 if (messages) { |
| 120 messages->push_back(PermissionMessage( | 120 messages->push_back( |
| 121 PermissionMessage::kUsbDevice, | 121 PermissionMessage(PermissionMessage::kUsbDevice, |
| 122 l10n_util::GetStringUTF16( | 122 l10n_util::GetStringUTF16( |
| 123 IDS_EXTENSION_PROMPT_WARNING_USB_DEVICE_LIST), | 123 IDS_EXTENSION_PROMPT_WARNING_USB_DEVICE_LIST), |
| 124 base::JoinString(details, base::ASCIIToUTF16("\n")))); | 124 JoinString(details, base::char16('\n')))); |
| 125 } | 125 } |
| 126 if (ids) { | 126 if (ids) { |
| 127 for (const auto& detail : details) | 127 for (const auto& detail : details) |
| 128 ids->insert(APIPermission::kUsbDeviceList, detail); | 128 ids->insert(APIPermission::kUsbDeviceList, detail); |
| 129 } | 129 } |
| 130 } | 130 } |
| 131 } | 131 } |
| 132 | 132 |
| 133 } // namespace | 133 } // namespace |
| 134 | 134 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 147 } | 147 } |
| 148 | 148 |
| 149 PermissionMessages UsbDevicePermission::GetMessages() const { | 149 PermissionMessages UsbDevicePermission::GetMessages() const { |
| 150 DCHECK(HasMessages()); | 150 DCHECK(HasMessages()); |
| 151 PermissionMessages messages; | 151 PermissionMessages messages; |
| 152 AddPermissionsToLists(data_set_, NULL, &messages); | 152 AddPermissionsToLists(data_set_, NULL, &messages); |
| 153 return messages; | 153 return messages; |
| 154 } | 154 } |
| 155 | 155 |
| 156 } // namespace extensions | 156 } // namespace extensions |
| OLD | NEW |