Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4859)

Unified Diff: chrome/common/extensions/permissions/chrome_permission_message_provider.cc

Issue 336313009: Showing devices transport method in one device (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698