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

Side by Side Diff: chrome/browser/media_gallery/media_device_notifications_linux.h

Issue 10829384: SystemMonitor: Pull device type into the device id (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 8 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 | Annotate | Revision Log
OLDNEW
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 // MediaDeviceNotificationsLinux listens for mount point changes and notifies 5 // MediaDeviceNotificationsLinux listens for mount point changes and notifies
6 // the SystemMonitor about the addition and deletion of media devices. 6 // the SystemMonitor about the addition and deletion of media devices.
7 7
8 #ifndef CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_LINUX_H_ 8 #ifndef CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_LINUX_H_
9 #define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_LINUX_H_ 9 #define CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_LINUX_H_
10 10
11 #if defined(OS_CHROMEOS) 11 #if defined(OS_CHROMEOS)
12 #error "Use the ChromeOS-specific implementation instead." 12 #error "Use the ChromeOS-specific implementation instead."
13 #endif 13 #endif
14 14
15 #include <map> 15 #include <map>
16 #include <set> 16 #include <set>
17 #include <string> 17 #include <string>
18 #include <utility> 18 #include <utility>
19 19
20 #include "base/basictypes.h" 20 #include "base/basictypes.h"
21 #include "base/compiler_specific.h" 21 #include "base/compiler_specific.h"
22 #include "base/files/file_path_watcher.h" 22 #include "base/files/file_path_watcher.h"
23 #include "base/memory/ref_counted.h" 23 #include "base/memory/ref_counted.h"
24 #include "content/public/browser/browser_thread.h" 24 #include "content/public/browser/browser_thread.h"
25 25
26 class FilePath; 26 class FilePath;
27 27
28 // Gets the media device information given a |device_path|. On success, 28 // Gets the media device information given a |device_path|. On success,
29 // returns true and fills in |device_name| and |device_id|. 29 // returns true and fills in |device_name| and |unique_id|.
kmadhusu 2012/08/20 21:02:20 nit: id => unique_id
vandebo (ex-Chrome) 2012/08/20 21:24:47 Done.
30 typedef bool (*GetDeviceInfoFunc)(const std::string& device_path, 30 typedef bool (*GetDeviceInfoFunc)(const std::string& device_path,
31 std::string* device_name, 31 std::string* id,
32 string16* device_id); 32 string16* name);
33 33
34 namespace chrome { 34 namespace chrome {
35 35
36 class MediaDeviceNotificationsLinux 36 class MediaDeviceNotificationsLinux
37 : public base::RefCountedThreadSafe<MediaDeviceNotificationsLinux, 37 : public base::RefCountedThreadSafe<MediaDeviceNotificationsLinux,
38 content::BrowserThread::DeleteOnFileThread> { 38 content::BrowserThread::DeleteOnFileThread> {
39 public: 39 public:
40 explicit MediaDeviceNotificationsLinux(const FilePath& path); 40 explicit MediaDeviceNotificationsLinux(const FilePath& path);
41 41
42 // Must be called for MediaDeviceNotificationsLinux to work. 42 // Must be called for MediaDeviceNotificationsLinux to work.
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 // Function handler to get device information. This is useful to set a mock 110 // Function handler to get device information. This is useful to set a mock
111 // handler for unit testing. 111 // handler for unit testing.
112 GetDeviceInfoFunc get_device_info_func_; 112 GetDeviceInfoFunc get_device_info_func_;
113 113
114 DISALLOW_COPY_AND_ASSIGN(MediaDeviceNotificationsLinux); 114 DISALLOW_COPY_AND_ASSIGN(MediaDeviceNotificationsLinux);
115 }; 115 };
116 116
117 } // namespace chrome 117 } // namespace chrome
118 118
119 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_LINUX_H_ 119 #endif // CHROME_BROWSER_MEDIA_GALLERY_MEDIA_DEVICE_NOTIFICATIONS_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698