| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_GALLERIES_FILEAPI_IAPPS_FINDER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_IAPPS_FINDER_IMPL_H_ |
| 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_IAPPS_FINDER_IMPL_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_IAPPS_FINDER_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| 11 #include "base/files/file_path.h" |
| 11 #include "chrome/browser/media_galleries/fileapi/iapps_finder.h" | 12 #include "chrome/browser/media_galleries/fileapi/iapps_finder.h" |
| 12 #include "chrome/browser/storage_monitor/storage_info.h" | 13 #include "chrome/browser/storage_monitor/storage_info.h" |
| 13 | 14 |
| 14 #if defined(OS_MACOSX) | 15 #if defined(OS_MACOSX) |
| 15 | 16 |
| 16 class MacPreferences; | 17 class MacPreferences; |
| 17 #if defined(__OBJC__) | 18 #if defined(__OBJC__) |
| 19 @class NSArray; |
| 18 @class NSString; | 20 @class NSString; |
| 19 #else // __OBJC__ | 21 #else // __OBJC__ |
| 22 class NSArray; |
| 20 class NSString; | 23 class NSString; |
| 21 #endif // __OBJC__ | 24 #endif // __OBJC__ |
| 22 | 25 |
| 23 #endif // OS_MACOSX | 26 #endif // OS_MACOSX |
| 24 | 27 |
| 25 namespace iapps { | 28 namespace iapps { |
| 26 | 29 |
| 27 #if defined(OS_MACOSX) | 30 #if defined(OS_MACOSX) |
| 28 | 31 |
| 29 extern NSString* const kIPhotoRecentDatabasesKey; | 32 extern NSString* const kIPhotoRecentDatabasesKey; |
| 30 extern NSString* const kITunesRecentDatabasePathsKey; | 33 extern NSString* const kITunesRecentDatabasePathsKey; |
| 31 | 34 |
| 32 // Set the mac preferences to use for testing. The caller continues to own | 35 // Set the mac preferences to use for testing. The caller continues to own |
| 33 // |preferences| and should call this function again with NULL before freeing | 36 // |preferences| and should call this function again with NULL before freeing |
| 34 // it. | 37 // it. |
| 35 void SetMacPreferencesForTesting(MacPreferences* preferences); | 38 void SetMacPreferencesForTesting(MacPreferences* preferences); |
| 36 | 39 |
| 40 // Returns an NSArray with a single string entry which is a path value. |
| 41 NSArray* NSArrayFromFilePath(const base::FilePath& path); |
| 42 |
| 37 #endif // OS_MACOSX | 43 #endif // OS_MACOSX |
| 38 | 44 |
| 39 typedef base::Callback<void(const IAppsFinderCallback&)> IAppsFinderTask; | 45 typedef base::Callback<void(const IAppsFinderCallback&)> IAppsFinderTask; |
| 40 | 46 |
| 41 // FindIAppsOnFileThread helps iApps finders by taking care of the details of | 47 // FindIAppsOnFileThread helps iApps finders by taking care of the details of |
| 42 // bouncing to the FILE thread to run |task| and then turning the result into a | 48 // bouncing to the FILE thread to run |task| and then turning the result into a |
| 43 // device id and posting it to |callback| on the UI thread. If |task| does not | 49 // device id and posting it to |callback| on the UI thread. If |task| does not |
| 44 // find the iApps's library, |callback| gets an empty string. | 50 // find the iApps's library, |callback| gets an empty string. |
| 45 void FindIAppsOnFileThread(StorageInfo::Type type, const IAppsFinderTask& task, | 51 void FindIAppsOnFileThread(StorageInfo::Type type, const IAppsFinderTask& task, |
| 46 const IAppsFinderCallback& callback); | 52 const IAppsFinderCallback& callback); |
| 47 | 53 |
| 48 } // namespace iapps | 54 } // namespace iapps |
| 49 | 55 |
| 50 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_IAPPS_FINDER_IMPL_H_ | 56 #endif // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_IAPPS_FINDER_IMPL_H_ |
| OLD | NEW |