Chromium Code Reviews| Index: chrome/common/extensions/permissions/chrome_permission_message_provider.cc |
| diff --git a/chrome/common/extensions/permissions/chrome_permission_message_provider.cc b/chrome/common/extensions/permissions/chrome_permission_message_provider.cc |
| index 6fa8e5b9c0e14fbaf31c5074cdf31ba242b6a184..7f5f19d116f99d081f6f8498623616a19f121baa 100644 |
| --- a/chrome/common/extensions/permissions/chrome_permission_message_provider.cc |
| +++ b/chrome/common/extensions/permissions/chrome_permission_message_provider.cc |
| @@ -111,6 +111,8 @@ std::vector<base::string16> ChromePermissionMessageProvider::GetWarningMessages( |
| bool media_galleries_read = false; |
| bool media_galleries_copy_to = false; |
| bool media_galleries_delete = false; |
| + int access_to_devices = 0; |
| + bool access_to_devices_message_pushed = false; |
| for (PermissionMessages::const_iterator i = messages.begin(); |
| i != messages.end(); ++i) { |
| switch (i->id()) { |
| @@ -129,6 +131,11 @@ std::vector<base::string16> ChromePermissionMessageProvider::GetWarningMessages( |
| case PermissionMessage::kMediaGalleriesAllGalleriesDelete: |
| media_galleries_delete = true; |
| break; |
| + case PermissionMessage::kBluetoothDevices: |
| + case PermissionMessage::kHid: |
| + case PermissionMessage::kSerial: |
| + case PermissionMessage::kUsbDevice: |
|
meacer
2014/06/18 02:25:02
These should be kUsb and kBluetooth instead, as th
Ken Rockot(use gerrit already)
2014/06/18 21:06:17
kUsb and kBluetooth are correct, yes.
The k[Usb,B
mhm
2014/06/18 22:16:44
rockot@ aren't these two only used to list the Blu
|
| + access_to_devices += 1; |
| default: |
| break; |
| } |
| @@ -137,6 +144,19 @@ std::vector<base::string16> ChromePermissionMessageProvider::GetWarningMessages( |
| for (PermissionMessages::const_iterator i = messages.begin(); |
| i != messages.end(); ++i) { |
| int id = i->id(); |
| + if (access_to_devices > 1) { |
| + if (!access_to_devices_message_pushed) { |
| + message_strings.push_back( |
| + l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_DEVICES)); |
| + access_to_devices_message_pushed = true; |
| + continue; |
| + } |
| + if (id == PermissionMessage::kBluetoothDevices || |
| + id == PermissionMessage::kHid || id == PermissionMessage::kSerial || |
| + id == PermissionMessage::kUsbDevice) { |
| + continue; |
| + } |
|
not at google - send to devlin
2014/06/18 20:53:32
I think the upgrade path here is a bit weird. What
|
| + } |
| if (audio_capture && video_capture) { |
| if (id == PermissionMessage::kAudioCapture) { |
| message_strings.push_back(l10n_util::GetStringUTF16( |