| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // RemovableDeviceNotificationsLinux implementation. | 5 // RemovableDeviceNotificationsLinux implementation. |
| 6 | 6 |
| 7 #include "chrome/browser/system_monitor/removable_device_notifications_linux.h" | 7 #include "chrome/browser/system_monitor/removable_device_notifications_linux.h" |
| 8 | 8 |
| 9 #include <libudev.h> | 9 #include <libudev.h> |
| 10 #include <mntent.h> | 10 #include <mntent.h> |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 428 mount_info_map_[mount_point] = | 428 mount_info_map_[mount_point] = |
| 429 mount_info_map_.find(other_mount_point)->second; | 429 mount_info_map_.find(other_mount_point)->second; |
| 430 return; | 430 return; |
| 431 } | 431 } |
| 432 | 432 |
| 433 std::string unique_id; | 433 std::string unique_id; |
| 434 string16 name; | 434 string16 name; |
| 435 bool removable; | 435 bool removable; |
| 436 get_device_info_func_(mount_device, &unique_id, &name, &removable); | 436 get_device_info_func_(mount_device, &unique_id, &name, &removable); |
| 437 | 437 |
| 438 | 438 // Keep track of device info details to see how often we get invalid values. |
| 439 // Keep track of device uuid, to see how often we receive empty values. | 439 MediaStorageUtil::RecordDeviceInfoHistogram(true, unique_id, name); |
| 440 UMA_HISTOGRAM_BOOLEAN("MediaDeviceNotification.DeviceUUIDAvailable", | |
| 441 !unique_id.empty()); | |
| 442 UMA_HISTOGRAM_BOOLEAN("MediaDeviceNotification.DeviceNameAvailable", | |
| 443 !name.empty()); | |
| 444 if (unique_id.empty() || name.empty()) | 440 if (unique_id.empty() || name.empty()) |
| 445 return; | 441 return; |
| 446 | 442 |
| 447 bool has_dcim = IsMediaDevice(mount_point.value()); | 443 bool has_dcim = IsMediaDevice(mount_point.value()); |
| 448 MediaStorageUtil::Type type; | 444 MediaStorageUtil::Type type; |
| 449 if (removable) { | 445 if (removable) { |
| 450 if (has_dcim) { | 446 if (has_dcim) { |
| 451 type = MediaStorageUtil::REMOVABLE_MASS_STORAGE_WITH_DCIM; | 447 type = MediaStorageUtil::REMOVABLE_MASS_STORAGE_WITH_DCIM; |
| 452 } else { | 448 } else { |
| 453 type = MediaStorageUtil::REMOVABLE_MASS_STORAGE_NO_DCIM; | 449 type = MediaStorageUtil::REMOVABLE_MASS_STORAGE_NO_DCIM; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 465 mount_info_map_[mount_point] = mount_point_info; | 461 mount_info_map_[mount_point] = mount_point_info; |
| 466 mount_priority_map_[mount_device][mount_point] = removable; | 462 mount_priority_map_[mount_device][mount_point] = removable; |
| 467 | 463 |
| 468 if (removable) { | 464 if (removable) { |
| 469 SystemMonitor::Get()->ProcessRemovableStorageAttached(device_id, name, | 465 SystemMonitor::Get()->ProcessRemovableStorageAttached(device_id, name, |
| 470 mount_point.value()); | 466 mount_point.value()); |
| 471 } | 467 } |
| 472 } | 468 } |
| 473 | 469 |
| 474 } // namespace chrome | 470 } // namespace chrome |
| OLD | NEW |