Home | History | Annotate | Download | only in fileapi
      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
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_FINDER_H_
      6 #define CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_FINDER_H_
      7 
      8 #include <string>
      9 
     10 #include "base/callback.h"
     11 #include "base/files/file_path.h"
     12 
     13 #if defined(OS_MACOSX)
     14 
     15 class MacPreferences;
     16 #if defined(__OBJC__)
     17 @class NSString;
     18 #else  // __OBJC__
     19 class NSString;
     20 #endif  // __OBJC__
     21 
     22 #endif  // OS_MACOSX
     23 
     24 namespace picasa {
     25 
     26 #if defined(OS_WIN)
     27 extern const wchar_t kPicasaRegistryPath[];
     28 extern const wchar_t kPicasaRegistryAppDataPathKey[];
     29 #endif
     30 
     31 #if defined(OS_MACOSX)
     32 extern NSString* const kPicasaAppDataPathMacPreferencesKey;
     33 #endif
     34 
     35 typedef base::Callback<void(const std::string&)> DeviceIDCallback;
     36 
     37 // Bounces to FILE thread to find Picasa database. If the platform supports
     38 // Picasa and a Picasa database is found, |callback| will be invoked on the
     39 // calling thread with the device ID. Otherwise, |callback| will be invoked
     40 // with an empty string.
     41 void FindPicasaDatabase(const DeviceIDCallback& callback);
     42 
     43 // Builds the OS-dependent Picasa database path from the app-data path.
     44 // Used internally and by tests to construct an test environments.
     45 base::FilePath MakePicasaDatabasePath(
     46     const base::FilePath& picasa_app_data_path);
     47 
     48 #if defined(OS_MACOSX)
     49 // Set the mac preferences to use for testing. The caller continues to own
     50 // |preferences| and should call this function again with NULL before freeing
     51 // it.
     52 void SetMacPreferencesForTesting(MacPreferences* preferences);
     53 
     54 // Used internally only.
     55 base::FilePath GetCustomPicasaAppDataPathFromMacPreferences();
     56 #endif  // OS_MACOSX
     57 
     58 }  // namespace picasa
     59 
     60 #endif  // CHROME_BROWSER_MEDIA_GALLERIES_FILEAPI_PICASA_FINDER_H_
     61