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 #ifndef CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ |
6 #define CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ | 6 #define CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 // A callback to handle mount events. | 171 // A callback to handle mount events. |
172 // The first argument is the event type. | 172 // The first argument is the event type. |
173 // The second argument is the device path. | 173 // The second argument is the device path. |
174 typedef base::Callback<void(MountEventType, const std::string&) | 174 typedef base::Callback<void(MountEventType, const std::string&) |
175 > MountEventHandler; | 175 > MountEventHandler; |
176 | 176 |
177 virtual ~CrosDisksClient(); | 177 virtual ~CrosDisksClient(); |
178 | 178 |
179 // Calls Mount method. |callback| is called after the method call succeeds, | 179 // Calls Mount method. |callback| is called after the method call succeeds, |
180 // otherwise, |error_callback| is called. | 180 // otherwise, |error_callback| is called. |
181 // When mounting an archive, the |source_format| argument passes the file | 181 // When mounting an archive, caller may set two optional arguments: |
182 // extension (with the leading dot, for example ".zip"). If |source_format| is | 182 // - The |source_format| argument passes the file extension (with the leading |
183 // empty then the source format is auto-detected. | 183 // dot, for example ".zip"). If |source_format| is empty then the source |
| 184 // format is auto-detected. |
| 185 // - The |mount_label| argument passes an optional mount label to be used as |
| 186 // the directory name of the mount point. If |mount_label| is empty, the |
| 187 // mount label will be based on the |source_path|. |
184 virtual void Mount(const std::string& source_path, | 188 virtual void Mount(const std::string& source_path, |
185 const std::string& source_format, | 189 const std::string& source_format, |
| 190 const std::string& mount_label, |
186 MountType type, | 191 MountType type, |
187 const MountCallback& callback, | 192 const MountCallback& callback, |
188 const ErrorCallback& error_callback) = 0; | 193 const ErrorCallback& error_callback) = 0; |
189 | 194 |
190 // Calls Unmount method. |callback| is called after the method call succeeds, | 195 // Calls Unmount method. |callback| is called after the method call succeeds, |
191 // otherwise, |error_callback| is called. | 196 // otherwise, |error_callback| is called. |
192 virtual void Unmount(const std::string& device_path, | 197 virtual void Unmount(const std::string& device_path, |
193 const UnmountCallback& callback, | 198 const UnmountCallback& callback, |
194 const ErrorCallback& error_callback) = 0; | 199 const ErrorCallback& error_callback) = 0; |
195 | 200 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 // Create() should be used instead. | 233 // Create() should be used instead. |
229 CrosDisksClient(); | 234 CrosDisksClient(); |
230 | 235 |
231 private: | 236 private: |
232 DISALLOW_COPY_AND_ASSIGN(CrosDisksClient); | 237 DISALLOW_COPY_AND_ASSIGN(CrosDisksClient); |
233 }; | 238 }; |
234 | 239 |
235 } // namespace chromeos | 240 } // namespace chromeos |
236 | 241 |
237 #endif // CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ | 242 #endif // CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ |
OLD | NEW |