summaryrefslogtreecommitdiffstats
path: root/base/system_monitor/system_monitor.h
diff options
context:
space:
mode:
authorthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-21 22:24:14 +0000
committerthestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-21 22:24:14 +0000
commit04b4c674bccff2db64a284ef6d64a822e8948eb0 (patch)
treea2283b88dd955353eef9071394f21ad5457d38ba /base/system_monitor/system_monitor.h
parentb0afd3f2eccdb165660407d962f462607eadf6d4 (diff)
downloadchromium_src-04b4c674bccff2db64a284ef6d64a822e8948eb0.zip
chromium_src-04b4c674bccff2db64a284ef6d64a822e8948eb0.tar.gz
chromium_src-04b4c674bccff2db64a284ef6d64a822e8948eb0.tar.bz2
Add SystemMonitor::GetAttachedMediaDevices().
BUG=none TEST=included Review URL: https://chromiumcodereview.appspot.com/10332190 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138148 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/system_monitor/system_monitor.h')
-rw-r--r--base/system_monitor/system_monitor.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/base/system_monitor/system_monitor.h b/base/system_monitor/system_monitor.h
index e0decc9..d88ef09 100644
--- a/base/system_monitor/system_monitor.h
+++ b/base/system_monitor/system_monitor.h
@@ -9,10 +9,12 @@
#include <map>
#include <string>
#include <utility>
+#include <vector>
#include "base/base_export.h"
#include "base/basictypes.h"
#include "base/threading/thread_checker.h"
+#include "base/tuple.h"
#include "build/build_config.h"
// Windows HiRes timers drain the battery faster so we need to know the battery
@@ -57,6 +59,8 @@ class BASE_EXPORT SystemMonitor {
};
typedef unsigned int DeviceIdType;
+ // (Media device id, Media device name, Media device path)
+ typedef Tuple3<DeviceIdType, std::string, FilePath> MediaDeviceInfo;
// Create SystemMonitor. Only one SystemMonitor instance per application
// is allowed.
@@ -155,6 +159,9 @@ class BASE_EXPORT SystemMonitor {
const FilePath& path);
void ProcessMediaDeviceDetached(const DeviceIdType& id);
+ // Returns information for attached media devices.
+ std::vector<MediaDeviceInfo>* GetAttachedMediaDevices() const;
+
// Enters or leaves a period of time with a given |requirement|. If the
// operation has multiple requirements, make sure to use a unique |reason| for
// each one. Reusing the same |reason| is OK as far as the |requirement| is
@@ -172,6 +179,8 @@ class BASE_EXPORT SystemMonitor {
size_t GetPowerRequirementsCountForTest() const;
private:
+ typedef std::map<base::SystemMonitor::DeviceIdType,
+ MediaDeviceInfo> MediaDeviceMap;
#if defined(OS_MACOSX)
void PlatformInit();
void PlatformDestroy();
@@ -211,6 +220,8 @@ class BASE_EXPORT SystemMonitor {
base::OneShotTimer<SystemMonitor> delayed_battery_check_;
#endif
+ MediaDeviceMap media_device_map_;
+
DISALLOW_COPY_AND_ASSIGN(SystemMonitor);
};