Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / media_galleries / media_galleries_test_util.h
blob599aa24cad19331ae5c78bba2bef0783d0f47ea7
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_
6 #define CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_
8 #include <string>
9 #include <vector>
11 #include "base/basictypes.h"
12 #include "base/files/scoped_temp_dir.h"
13 #include "base/memory/ref_counted.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "base/test/scoped_path_override.h"
17 #if defined(OS_WIN)
18 #include "base/test/test_reg_util_win.h"
19 #endif
21 namespace extensions {
22 class Extension;
25 namespace registry_util {
26 class RegistryOverrideManager;
29 class Profile;
31 #if defined(OS_MACOSX)
32 class MockPreferences;
33 #endif
35 scoped_refptr<extensions::Extension> AddMediaGalleriesApp(
36 const std::string& name,
37 const std::vector<std::string>& media_galleries_permissions,
38 Profile* profile);
40 class EnsureMediaDirectoriesExists {
41 public:
42 EnsureMediaDirectoriesExists();
43 ~EnsureMediaDirectoriesExists();
45 int num_galleries() const { return num_galleries_; }
47 base::FilePath GetFakeAppDataPath() const;
49 // Changes the directories for the media paths (music, pictures, videos)
50 // overrides to new, different directories that are generated.
51 void ChangeMediaPathOverrides();
52 #if defined(OS_WIN)
53 base::FilePath GetFakeLocalAppDataPath() const;
54 #endif
55 #if defined(OS_WIN) || defined(OS_MACOSX)
56 void SetCustomPicasaAppDataPath(const base::FilePath& path);
57 base::FilePath GetFakePicasaFoldersRootPath() const;
58 #endif
60 #if defined(OS_MACOSX)
61 base::FilePath GetFakeITunesRootPath() const;
62 base::FilePath GetFakeIPhotoRootPath() const;
63 #endif
65 private:
66 void Init();
68 base::ScopedTempDir fake_dir_;
70 int num_galleries_;
72 int times_overrides_changed_;
74 scoped_ptr<base::ScopedPathOverride> app_data_override_;
75 scoped_ptr<base::ScopedPathOverride> music_override_;
76 scoped_ptr<base::ScopedPathOverride> pictures_override_;
77 scoped_ptr<base::ScopedPathOverride> video_override_;
78 #if defined(OS_WIN)
79 scoped_ptr<base::ScopedPathOverride> local_app_data_override_;
81 registry_util::RegistryOverrideManager registry_override_;
82 #endif
83 #if defined(OS_MACOSX)
84 scoped_ptr<MockPreferences> mac_preferences_;
85 #endif
87 DISALLOW_COPY_AND_ASSIGN(EnsureMediaDirectoriesExists);
90 extern base::FilePath MakeMediaGalleriesTestingPath(const std::string& dir);
92 #endif // CHROME_BROWSER_MEDIA_GALLERIES_MEDIA_GALLERIES_TEST_UTIL_H_