chrome/browser/system_monitor/portable_device_watcher_win.cc
// Handles the device attach event message on a media task runner.
// |pnp_device_id| specifies the attached plug and play device ID string. On
// success, returns true and populates |device_details| with device information.
// On failure, returns false.
Handles the device attach event message on a media task runner.
|pnp_device_id| specifies the attached plug and play device ID string. On
success, returns true and populates |device_details| with device information.
On failure, returns false.
Handles the device attach event message on a media task runner . |pnp_device_id| specifies the attached plug and play device ID string . On success returns true and populates |device_details| with device information . On failure returns false .
bool HandleDeviceAttachedEventOnBlockingThread(
    const string16& pnp_device_id,
    PortableDeviceWatcherWin::DeviceDetails* device_details) {
  DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread());
  DCHECK(device_details);
  base::win::ScopedComPtr<IPortableDeviceManager> portable_device_mgr;
  if (!GetPortableDeviceManager(&portable_device_mgr))
    return false;
  portable_device_mgr->RefreshDeviceList();
  return GetDeviceInfoOnBlockingThread(portable_device_mgr, pnp_device_id,
                                       device_details);
}
bool HandleDeviceAttachedEventOnBlockingThread ( const string16 & pnp_device_id , PortableDeviceWatcherWin :: DeviceDetails * device_details ) { DCHECK ( content :: BrowserThread :: GetBlockingPool ( ) -> RunsTasksOnCurrentThread ( ) ) ; DCHECK ( device_details ) ; base :: win :: ScopedComPtr < IPortableDeviceManager > portable_device_mgr ; if ( ! GetPortableDeviceManager ( & portable_device_mgr ) ) return false ; portable_device_mgr -> RefreshDeviceList ( ) ; return GetDeviceInfoOnBlockingThread ( portable_device_mgr , pnp_device_id , device_details ) ; }
Handles the device attach event message on a media task runner.
Handles the device attach event message on a media task runner .
// Sometimes, portable device manager doesn't have the new device details. // Refresh the manager device list to update its details.