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

Unified Diff: chrome/browser/usb/usb_service.cc

Issue 15713003: Supresses app permissions changed dialogs in kiosk mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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
Index: chrome/browser/usb/usb_service.cc
diff --git a/chrome/browser/usb/usb_service.cc b/chrome/browser/usb/usb_service.cc
index fcad23d94fc78ee555ac23a2cacbb330f056096c..ec75d512c7302a4c3f5f51b28fb85119e6e14e5f 100644
--- a/chrome/browser/usb/usb_service.cc
+++ b/chrome/browser/usb/usb_service.cc
@@ -14,6 +14,7 @@
#include "third_party/libusb/src/libusb/libusb.h"
#if defined(OS_CHROMEOS)
+#include "base/chromeos/chromeos_version.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/permission_broker_client.h"
#endif // defined(OS_CHROMEOS)
@@ -74,22 +75,26 @@ void UsbService::FindDevices(const uint16 vendor_id,
const base::Callback<void()>& callback) {
DCHECK(event_handler_) << "FindDevices called after event handler stopped.";
#if defined(OS_CHROMEOS)
- chromeos::PermissionBrokerClient* client =
- chromeos::DBusThreadManager::Get()->GetPermissionBrokerClient();
- DCHECK(client) << "Could not get permission broker client.";
- if (!client) {
- callback.Run();
- return;
- }
+ if (base::chromeos::IsRunningOnChromeOS()) {
+ chromeos::PermissionBrokerClient* client =
+ chromeos::DBusThreadManager::Get()->GetPermissionBrokerClient();
+ DCHECK(client) << "Could not get permission broker client.";
+ if (!client) {
+ callback.Run();
+ return;
+ }
- client->RequestUsbAccess(vendor_id,
- product_id,
- base::Bind(&UsbService::FindDevicesImpl,
- base::Unretained(this),
- vendor_id,
- product_id,
- devices,
- callback));
+ client->RequestUsbAccess(vendor_id,
+ product_id,
+ base::Bind(&UsbService::FindDevicesImpl,
+ base::Unretained(this),
+ vendor_id,
+ product_id,
+ devices,
+ callback));
+ } else {
+ FindDevicesImpl(vendor_id, product_id, devices, callback, true);
+ }
#else
FindDevicesImpl(vendor_id, product_id, devices, callback, true);
#endif // defined(OS_CHROMEOS)

Powered by Google App Engine
This is Rietveld 408576698