| 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 CHROME_BROWSER_MEDIA_TRANSFER_PROTOCOL_MEDIA_TRANSFER_PROTOCOL_MANAGER_H
_ | 5 #ifndef DEVICE_MEDIA_TRANSFER_PROTOCOL_MEDIA_TRANSFER_PROTOCOL_MANAGER_H_ |
| 6 #define CHROME_BROWSER_MEDIA_TRANSFER_PROTOCOL_MEDIA_TRANSFER_PROTOCOL_MANAGER_H
_ | 6 #define DEVICE_MEDIA_TRANSFER_PROTOCOL_MEDIA_TRANSFER_PROTOCOL_MANAGER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 | 13 |
| 14 #if !defined(OS_LINUX) | 14 #if !defined(OS_LINUX) |
| 15 #error "Only used on Linux and ChromeOS" | 15 #error "Only used on Linux and ChromeOS" |
| 16 #endif | 16 #endif |
| 17 | 17 |
| 18 class MtpFileEntry; | 18 class MtpFileEntry; |
| 19 class MtpStorageInfo; | 19 class MtpStorageInfo; |
| 20 | 20 |
| 21 namespace chrome { | 21 namespace device { |
| 22 | 22 |
| 23 // This class handles the interaction with mtpd. | 23 // This class handles the interaction with mtpd. |
| 24 // Other classes can add themselves as observers. | 24 // Other classes can add themselves as observers. |
| 25 class MediaTransferProtocolManager { | 25 class MediaTransferProtocolManager { |
| 26 public: | 26 public: |
| 27 // A callback to handle the result of OpenStorage. | 27 // A callback to handle the result of OpenStorage. |
| 28 // The first argument is the returned handle. | 28 // The first argument is the returned handle. |
| 29 // The second argument is true if there was an error. | 29 // The second argument is true if there was an error. |
| 30 typedef base::Callback<void(const std::string& handle, | 30 typedef base::Callback<void(const std::string& handle, |
| 31 bool error)> OpenStorageCallback; | 31 bool error)> OpenStorageCallback; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 static void Initialize(); | 131 static void Initialize(); |
| 132 | 132 |
| 133 // Destroys the global MediaTransferProtocolManager instance if it exists. | 133 // Destroys the global MediaTransferProtocolManager instance if it exists. |
| 134 static void Shutdown(); | 134 static void Shutdown(); |
| 135 | 135 |
| 136 // Returns a pointer to the global MediaTransferProtocolManager instance. | 136 // Returns a pointer to the global MediaTransferProtocolManager instance. |
| 137 // Initialize() should already have been called. | 137 // Initialize() should already have been called. |
| 138 static MediaTransferProtocolManager* GetInstance(); | 138 static MediaTransferProtocolManager* GetInstance(); |
| 139 }; | 139 }; |
| 140 | 140 |
| 141 } // namespace chrome | 141 } // namespace device |
| 142 | 142 |
| 143 #endif // CHROME_BROWSER_MEDIA_TRANSFER_PROTOCOL_MEDIA_TRANSFER_PROTOCOL_MANAGE
R_H_ | 143 #endif // DEVICE_MEDIA_TRANSFER_PROTOCOL_MEDIA_TRANSFER_PROTOCOL_MANAGER_H_ |
| OLD | NEW |