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_TEST_BASE_TESTING_PROFILE_MANAGER_H_ | 5 #ifndef CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ |
6 #define CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ | 6 #define CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
13 #include "base/files/scoped_temp_dir.h" | 13 #include "base/files/scoped_temp_dir.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
17 #include "chrome/test/base/scoped_testing_local_state.h" | 17 #include "chrome/test/base/scoped_testing_local_state.h" |
18 #include "chrome/test/base/testing_profile.h" | 18 #include "chrome/test/base/testing_profile.h" |
19 | 19 |
20 class ProfileInfoCache; | 20 class ProfileInfoCache; |
| 21 class ProfileAttributesStorage; |
21 class ProfileManager; | 22 class ProfileManager; |
22 class TestingBrowserProcess; | 23 class TestingBrowserProcess; |
23 class TestingProfile; | 24 class TestingProfile; |
24 | 25 |
25 namespace syncable_prefs { | 26 namespace syncable_prefs { |
26 class PrefServiceSyncable; | 27 class PrefServiceSyncable; |
27 } | 28 } |
28 | 29 |
29 // The TestingProfileManager is a TestingProfile factory for a multi-profile | 30 // The TestingProfileManager is a TestingProfile factory for a multi-profile |
30 // environment. It will bring up a full ProfileManager and attach it to the | 31 // environment. It will bring up a full ProfileManager and attach it to the |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // Sets ProfileManager's logged_in state. This is only useful on ChromeOS. | 99 // Sets ProfileManager's logged_in state. This is only useful on ChromeOS. |
99 void SetLoggedIn(bool logged_in); | 100 void SetLoggedIn(bool logged_in); |
100 | 101 |
101 // Sets the last used profile; also sets the active time to now. | 102 // Sets the last used profile; also sets the active time to now. |
102 void UpdateLastUser(Profile* last_active); | 103 void UpdateLastUser(Profile* last_active); |
103 | 104 |
104 // Helper accessors. | 105 // Helper accessors. |
105 const base::FilePath& profiles_dir(); | 106 const base::FilePath& profiles_dir(); |
106 ProfileManager* profile_manager(); | 107 ProfileManager* profile_manager(); |
107 ProfileInfoCache* profile_info_cache(); | 108 ProfileInfoCache* profile_info_cache(); |
| 109 ProfileAttributesStorage* profile_attributes_storage(); |
108 | 110 |
109 private: | 111 private: |
110 typedef std::map<std::string, TestingProfile*> TestingProfilesMap; | 112 typedef std::map<std::string, TestingProfile*> TestingProfilesMap; |
111 | 113 |
112 // Does the actual ASSERT-checked SetUp work. This function cannot have a | 114 // Does the actual ASSERT-checked SetUp work. This function cannot have a |
113 // return value, so it sets the |called_set_up_| flag on success and that is | 115 // return value, so it sets the |called_set_up_| flag on success and that is |
114 // returned in the public SetUp. | 116 // returned in the public SetUp. |
115 void SetUpInternal(); | 117 void SetUpInternal(); |
116 | 118 |
117 // Whether SetUp() was called to put the object in a valid state. | 119 // Whether SetUp() was called to put the object in a valid state. |
(...skipping 11 matching lines...) Expand all Loading... |
129 // Weak reference to the profile manager. | 131 // Weak reference to the profile manager. |
130 ProfileManager* profile_manager_; | 132 ProfileManager* profile_manager_; |
131 | 133 |
132 // Map of profile_name to TestingProfile* from CreateTestingProfile(). | 134 // Map of profile_name to TestingProfile* from CreateTestingProfile(). |
133 TestingProfilesMap testing_profiles_; | 135 TestingProfilesMap testing_profiles_; |
134 | 136 |
135 DISALLOW_COPY_AND_ASSIGN(TestingProfileManager); | 137 DISALLOW_COPY_AND_ASSIGN(TestingProfileManager); |
136 }; | 138 }; |
137 | 139 |
138 #endif // CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ | 140 #endif // CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ |
OLD | NEW |