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

Side by Side Diff: chrome/browser/devtools/device/usb/android_usb_device.cc

Issue 462753002: Add usb_service::UsbDeviceFilter class for device matching. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add UsbDevice::RequestUsbAccess to the mock (and fix spelling). Created 6 years, 4 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 unified diff | Download patch
OLDNEW
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 "chrome/browser/devtools/device/usb/android_usb_device.h" 5 #include "chrome/browser/devtools/device/usb/android_usb_device.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/barrier_closure.h" 9 #include "base/barrier_closure.h"
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 continue; 270 continue;
271 } 271 }
272 272
273 bool has_android_interface = false; 273 bool has_android_interface = false;
274 for (size_t j = 0; j < config->GetNumInterfaces(); ++j) { 274 for (size_t j = 0; j < config->GetNumInterfaces(); ++j) {
275 if (!IsAndroidInterface(config->GetInterface(j))) 275 if (!IsAndroidInterface(config->GetInterface(j)))
276 continue; 276 continue;
277 277
278 // Request permission on Chrome OS. 278 // Request permission on Chrome OS.
279 #if defined(OS_CHROMEOS) 279 #if defined(OS_CHROMEOS)
280 (*it)->RequestUsbAcess(j, base::Bind(&OpenAndroidDeviceOnFileThread, 280 (*it)->RequestUsbAccess(j, base::Bind(&OpenAndroidDeviceOnFileThread,
281 devices, rsa_key, barrier, *it, j)); 281 devices, rsa_key, barrier, *it, j));
282 #else 282 #else
283 OpenAndroidDeviceOnFileThread(devices, rsa_key, barrier, *it, j, true); 283 OpenAndroidDeviceOnFileThread(devices, rsa_key, barrier, *it, j, true);
284 #endif // defined(OS_CHROMEOS) 284 #endif // defined(OS_CHROMEOS)
285 285
286 has_android_interface = true; 286 has_android_interface = true;
287 break; 287 break;
288 } 288 }
289 if (!has_android_interface) 289 if (!has_android_interface)
290 barrier.Run(); 290 barrier.Run();
291 } 291 }
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after
645 BrowserThread::PostTask( 645 BrowserThread::PostTask(
646 BrowserThread::FILE, FROM_HERE, 646 BrowserThread::FILE, FROM_HERE,
647 base::Bind(&ReleaseInterface, usb_handle, interface_id_)); 647 base::Bind(&ReleaseInterface, usb_handle, interface_id_));
648 } 648 }
649 649
650 void AndroidUsbDevice::SocketDeleted(uint32 socket_id) { 650 void AndroidUsbDevice::SocketDeleted(uint32 socket_id) {
651 DCHECK(message_loop_ == base::MessageLoop::current()); 651 DCHECK(message_loop_ == base::MessageLoop::current());
652 652
653 sockets_.erase(socket_id); 653 sockets_.erase(socket_id);
654 } 654 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/device/usb/android_usb_browsertest.cc ('k') | chromeos/dbus/permission_broker_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698