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

Side by Side Diff: chrome/browser/system_monitor/portable_device_watcher_win.h

Issue 12147002: Add a receiver interface to RemovableStorageNotifications. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 10 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
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 #ifndef CHROME_BROWSER_SYSTEM_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ 5 #ifndef CHROME_BROWSER_SYSTEM_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_
6 #define CHROME_BROWSER_SYSTEM_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ 6 #define CHROME_BROWSER_SYSTEM_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_
7 7
8 #include <portabledeviceapi.h> 8 #include <portabledeviceapi.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // identifier. 86 // identifier.
87 virtual bool GetMTPStorageInfoFromDeviceId( 87 virtual bool GetMTPStorageInfoFromDeviceId(
88 const std::string& storage_device_id, 88 const std::string& storage_device_id,
89 string16* device_location, 89 string16* device_location,
90 string16* storage_object_id) const; 90 string16* storage_object_id) const;
91 91
92 // Constructs and returns a storage path from storage unique identifier. 92 // Constructs and returns a storage path from storage unique identifier.
93 static string16 GetStoragePathFromStorageId( 93 static string16 GetStoragePathFromStorageId(
94 const std::string& storage_unique_id); 94 const std::string& storage_unique_id);
95 95
96 // Set the volume notifications object to be used when new
97 // devices are found.
98 void SetNotifications(RemovableStorageNotifications::Receiver* notifications);
99
96 private: 100 private:
97 friend class test::TestPortableDeviceWatcherWin; 101 friend class test::TestPortableDeviceWatcherWin;
98 102
99 // Key: MTP device storage unique id. 103 // Key: MTP device storage unique id.
100 // Value: Metadata for the given storage. 104 // Value: Metadata for the given storage.
101 typedef std::map<std::string, RemovableStorageNotifications::StorageInfo> 105 typedef std::map<std::string, RemovableStorageNotifications::StorageInfo>
102 MTPStorageMap; 106 MTPStorageMap;
103 107
104 // Key: MTP device plug and play ID string. 108 // Key: MTP device plug and play ID string.
105 // Value: Vector of device storage objects. 109 // Value: Vector of device storage objects.
(...skipping 21 matching lines...) Expand all
127 // Attached media transfer protocol device storage objects map. 131 // Attached media transfer protocol device storage objects map.
128 MTPStorageMap storage_map_; 132 MTPStorageMap storage_map_;
129 133
130 // The task runner used to execute tasks that may take a long time and thus 134 // The task runner used to execute tasks that may take a long time and thus
131 // should not be performed on the UI thread. 135 // should not be performed on the UI thread.
132 scoped_refptr<base::SequencedTaskRunner> media_task_runner_; 136 scoped_refptr<base::SequencedTaskRunner> media_task_runner_;
133 137
134 // Used by |media_task_runner_| to create cancelable callbacks. 138 // Used by |media_task_runner_| to create cancelable callbacks.
135 base::WeakPtrFactory<PortableDeviceWatcherWin> weak_ptr_factory_; 139 base::WeakPtrFactory<PortableDeviceWatcherWin> weak_ptr_factory_;
136 140
141 // The notifications object to use to signal newly attached devices.
142 RemovableStorageNotifications::Receiver* storage_notifications_;
143
137 DISALLOW_COPY_AND_ASSIGN(PortableDeviceWatcherWin); 144 DISALLOW_COPY_AND_ASSIGN(PortableDeviceWatcherWin);
138 }; 145 };
139 146
140 } // namespace chrome 147 } // namespace chrome
141 148
142 #endif // CHROME_BROWSER_SYSTEM_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_ 149 #endif // CHROME_BROWSER_SYSTEM_MONITOR_PORTABLE_DEVICE_WATCHER_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698