| 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_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_ | 5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_ |
| 6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_ | 6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| 11 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/test/scoped_path_override.h" | 12 #include "base/test/scoped_path_override.h" |
| 13 | 13 |
| 14 #if defined(OS_WIN) |
| 15 #include "base/test/test_reg_util_win.h" |
| 16 #endif |
| 17 |
| 14 namespace extensions { | 18 namespace extensions { |
| 15 class Extension; | 19 class Extension; |
| 16 } | 20 } |
| 17 | 21 |
| 22 namespace registry_util { |
| 23 class RegistryOverrideManager; |
| 24 } |
| 25 |
| 18 class Profile; | 26 class Profile; |
| 19 | 27 |
| 20 scoped_refptr<extensions::Extension> AddMediaGalleriesApp( | 28 scoped_refptr<extensions::Extension> AddMediaGalleriesApp( |
| 21 const std::string& name, | 29 const std::string& name, |
| 22 const std::vector<std::string>& media_galleries_permissions, | 30 const std::vector<std::string>& media_galleries_permissions, |
| 23 Profile* profile); | 31 Profile* profile); |
| 24 | 32 |
| 25 class EnsureMediaDirectoriesExists { | 33 class EnsureMediaDirectoriesExists { |
| 26 public: | 34 public: |
| 27 EnsureMediaDirectoriesExists(); | 35 EnsureMediaDirectoriesExists(); |
| 28 ~EnsureMediaDirectoriesExists(); | 36 ~EnsureMediaDirectoriesExists(); |
| 29 | 37 |
| 30 int num_galleries() const { return num_galleries_; } | 38 int num_galleries() const { return num_galleries_; } |
| 31 | 39 |
| 32 base::FilePath GetFakeAppDataPath() const; | 40 base::FilePath GetFakeAppDataPath() const; |
| 33 #if defined(OS_WIN) | 41 #if defined(OS_WIN) |
| 34 base::FilePath GetFakeLocalAppDataPath() const; | 42 base::FilePath GetFakeLocalAppDataPath() const; |
| 43 void WriteCustomPicasaAppDataPathToRegistry(const base::FilePath& path); |
| 35 #endif | 44 #endif |
| 36 #if defined(OS_WIN) || defined(OS_MACOSX) | 45 #if defined(OS_WIN) || defined(OS_MACOSX) |
| 37 base::FilePath GetFakePicasaFoldersRootPath() const; | 46 base::FilePath GetFakePicasaFoldersRootPath() const; |
| 38 #endif | 47 #endif |
| 39 | 48 |
| 40 private: | 49 private: |
| 41 void Init(); | 50 void Init(); |
| 42 | 51 |
| 43 base::ScopedTempDir fake_dir_; | 52 base::ScopedTempDir fake_dir_; |
| 44 | 53 |
| 45 int num_galleries_; | 54 int num_galleries_; |
| 46 | 55 |
| 47 scoped_ptr<base::ScopedPathOverride> app_data_override_; | 56 scoped_ptr<base::ScopedPathOverride> app_data_override_; |
| 48 scoped_ptr<base::ScopedPathOverride> music_override_; | 57 scoped_ptr<base::ScopedPathOverride> music_override_; |
| 49 scoped_ptr<base::ScopedPathOverride> pictures_override_; | 58 scoped_ptr<base::ScopedPathOverride> pictures_override_; |
| 50 scoped_ptr<base::ScopedPathOverride> video_override_; | 59 scoped_ptr<base::ScopedPathOverride> video_override_; |
| 51 #if defined(OS_WIN) | 60 #if defined(OS_WIN) |
| 52 scoped_ptr<base::ScopedPathOverride> local_app_data_override_; | 61 scoped_ptr<base::ScopedPathOverride> local_app_data_override_; |
| 62 |
| 63 registry_util::RegistryOverrideManager registry_override_; |
| 53 #endif | 64 #endif |
| 54 | 65 |
| 55 DISALLOW_COPY_AND_ASSIGN(EnsureMediaDirectoriesExists); | 66 DISALLOW_COPY_AND_ASSIGN(EnsureMediaDirectoriesExists); |
| 56 }; | 67 }; |
| 57 | 68 |
| 58 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_ | 69 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_ |
| OLD | NEW |