14e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// Copyright 2013 The Chromium Authors. All rights reserved.
24e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
34e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// found in the LICENSE file.
44e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
54e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_IAPPS_FINDER_H_
64e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_IAPPS_FINDER_H_
74e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
84e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include <string>
94e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
104e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#include "base/callback.h"
114e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
124e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)namespace iapps {
134e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
144e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)typedef base::Callback<void(const std::string&)> IAppsFinderCallback;
154e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
164e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// These methods look for the iTunes/iPhoto library in in an asynchronous
174e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// manner and call |callback| on the UI thread as soon as the result is known.
184e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// If a library exists, |callback| gets the device id for the library. If a
194e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// library does not exist, or the OS does not support iTunes/iPhoto, then
204e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)// |callback| gets an empty string.
214e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
224e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)void FindIPhotoLibrary(const IAppsFinderCallback& callback);
234e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
244e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)void FindITunesLibrary(const IAppsFinderCallback& callback);
254e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
26f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)// These methods returns true if |path| should be interpreted as the device
27f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)// indicated by |device_id|.
28f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)
29f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)bool PathIndicatesIPhotoLibrary(const std::string& device_id,
30f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)                                const base::FilePath& path);
31f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)
32f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)bool PathIndicatesITunesLibrary(const std::string& device_id,
33f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)                                const base::FilePath& path);
34f8ee788a64d60abd8f2d742a5fdedde054ecd910Torne (Richard Coles)
354e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)}  // namespace iapps
364e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)
374e180b6a0b4720a9b8e9e959a882386f690f08ffTorne (Richard Coles)#endif  // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_IAPPS_FINDER_H_
38