| 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 #include "content/browser/device_monitor_mac.h" | 5 #include "content/browser/device_monitor_mac.h" |
| 6 | 6 |
| 7 #import <QTKit/QTKit.h> | 7 #import <QTKit/QTKit.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 class DeviceInfo { | 25 class DeviceInfo { |
| 26 public: | 26 public: |
| 27 enum DeviceType { | 27 enum DeviceType { |
| 28 kAudio, | 28 kAudio, |
| 29 kVideo, | 29 kVideo, |
| 30 kMuxed, | 30 kMuxed, |
| 31 kUnknown, | 31 kUnknown, |
| 32 kInvalid | 32 kInvalid |
| 33 }; | 33 }; |
| 34 | 34 |
| 35 DeviceInfo(std::string unique_id, DeviceType type) | 35 DeviceInfo(const std::string& unique_id, DeviceType type) |
| 36 : unique_id_(unique_id), type_(type) {} | 36 : unique_id_(unique_id), type_(type) {} |
| 37 | 37 |
| 38 // Operator== is needed here to use this class in a std::find. A given | 38 // Operator== is needed here to use this class in a std::find. A given |
| 39 // |unique_id_| always has the same |type_| so for comparison purposes the | 39 // |unique_id_| always has the same |type_| so for comparison purposes the |
| 40 // latter can be safely ignored. | 40 // latter can be safely ignored. |
| 41 bool operator==(const DeviceInfo& device) const { | 41 bool operator==(const DeviceInfo& device) const { |
| 42 return unique_id_ == device.unique_id_; | 42 return unique_id_ == device.unique_id_; |
| 43 } | 43 } |
| 44 | 44 |
| 45 const std::string& unique_id() const { return unique_id_; } | 45 const std::string& unique_id() const { return unique_id_; } |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 } | 552 } |
| 553 | 553 |
| 554 void DeviceMonitorMac::NotifyDeviceChanged( | 554 void DeviceMonitorMac::NotifyDeviceChanged( |
| 555 base::SystemMonitor::DeviceType type) { | 555 base::SystemMonitor::DeviceType type) { |
| 556 DCHECK(thread_checker_.CalledOnValidThread()); | 556 DCHECK(thread_checker_.CalledOnValidThread()); |
| 557 // TODO(xians): Remove the global variable for SystemMonitor. | 557 // TODO(xians): Remove the global variable for SystemMonitor. |
| 558 base::SystemMonitor::Get()->ProcessDevicesChanged(type); | 558 base::SystemMonitor::Get()->ProcessDevicesChanged(type); |
| 559 } | 559 } |
| 560 | 560 |
| 561 } // namespace content | 561 } // namespace content |
| OLD | NEW |