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

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: Collabsed the string but included the transport 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
« chrome/app/generated_resources.grd ('K') | « 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..d0204fdd8d197997186e59e5b4ae94a023650185 100644
--- a/chrome/common/extensions/permissions/chrome_permission_message_provider.cc
+++ b/chrome/common/extensions/permissions/chrome_permission_message_provider.cc
@@ -111,6 +111,10 @@ std::vector<base::string16> ChromePermissionMessageProvider::GetWarningMessages(
bool media_galleries_read = false;
bool media_galleries_copy_to = false;
bool media_galleries_delete = false;
+ bool bluetooth = false;
+ bool usb = false;
+ bool serial = false;
+ bool hid = false;
for (PermissionMessages::const_iterator i = messages.begin();
i != messages.end(); ++i) {
switch (i->id()) {
@@ -129,6 +133,17 @@ std::vector<base::string16> ChromePermissionMessageProvider::GetWarningMessages(
case PermissionMessage::kMediaGalleriesAllGalleriesDelete:
media_galleries_delete = true;
break;
+ case PermissionMessage::kBluetoothDevices:
+ bluetooth = true;
+ break;
+ case PermissionMessage::kHid:
+ hid = true;
+ break;
+ case PermissionMessage::kSerial:
+ serial = true;
+ break;
+ case PermissionMessage::kUsbDevice:
+ usb = true;
default:
break;
}
@@ -137,6 +152,36 @@ std::vector<base::string16> ChromePermissionMessageProvider::GetWarningMessages(
for (PermissionMessages::const_iterator i = messages.begin();
i != messages.end(); ++i) {
int id = i->id();
+ if ((bluetooth && usb && serial) || (hid && serial)) {
+ if (id == PermissionMessage::kSerial) {
+ message_strings.push_back(
+ l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_DEVICES));
+ continue;
+ } else if (id == PermissionMessage::kBluetoothDevices ||
+ id == PermissionMessage::kUsbDevice ||
+ id == PermissionMessage::kHid) {
+ // The combined message will be pushed above.
+ continue;
+ }
+ }
+ if (usb || bluetooth) {
+ if (hid) {
+ if (id == PermissionMessage::kBluetoothDevices ||
+ id == PermissionMessage::kUsbDevice) {
+ // kHid message will be pushed instead
+ continue;
+ }
+ } else if (usb && bluetooth) {
+ if (id == PermissionMessage::kUsbDevice) {
+ message_strings.push_back(
+ l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_WARNING_HID));
not at google - send to devlin 2014/06/20 22:25:32 apparently I was supposed to review this actually.
+ continue;
+ } else if (id == PermissionMessage::kBluetoothDevices) {
+ // The combined message will be pushed above.
+ continue;
+ }
+ }
+ }
if (audio_capture && video_capture) {
if (id == PermissionMessage::kAudioCapture) {
message_strings.push_back(l10n_util::GetStringUTF16(
« chrome/app/generated_resources.grd ('K') | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698