| 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 |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 77 // Deletes a guest TestingProfile from the profile manager. | 77 // Deletes a guest TestingProfile from the profile manager. |
| 78 void DeleteGuestProfile(); | 78 void DeleteGuestProfile(); |
| 79 | 79 |
| 80 // Deletes the cache instance. This is useful for testing that the cache is | 80 // Deletes the cache instance. This is useful for testing that the cache is |
| 81 // properly persisting data. | 81 // properly persisting data. |
| 82 void DeleteProfileInfoCache(); | 82 void DeleteProfileInfoCache(); |
| 83 | 83 |
| 84 // Sets ProfileManager's logged_in state. This is only useful on ChromeOS. | 84 // Sets ProfileManager's logged_in state. This is only useful on ChromeOS. |
| 85 void SetLoggedIn(bool logged_in); | 85 void SetLoggedIn(bool logged_in); |
| 86 | 86 |
| 87 // Sets the last used profile; also sets the active time to now. |
| 88 void UpdateLastUser(Profile* last_active); |
| 89 |
| 87 // Helper accessors. | 90 // Helper accessors. |
| 88 const base::FilePath& profiles_dir(); | 91 const base::FilePath& profiles_dir(); |
| 89 ProfileManager* profile_manager(); | 92 ProfileManager* profile_manager(); |
| 90 ProfileInfoCache* profile_info_cache(); | 93 ProfileInfoCache* profile_info_cache(); |
| 91 | 94 |
| 92 private: | 95 private: |
| 93 typedef std::map<std::string, TestingProfile*> TestingProfilesMap; | 96 typedef std::map<std::string, TestingProfile*> TestingProfilesMap; |
| 94 | 97 |
| 95 // Does the actual ASSERT-checked SetUp work. This function cannot have a | 98 // Does the actual ASSERT-checked SetUp work. This function cannot have a |
| 96 // return value, so it sets the |called_set_up_| flag on success and that is | 99 // return value, so it sets the |called_set_up_| flag on success and that is |
| (...skipping 15 matching lines...) Expand all Loading... |
| 112 // Weak reference to the profile manager. | 115 // Weak reference to the profile manager. |
| 113 ProfileManager* profile_manager_; | 116 ProfileManager* profile_manager_; |
| 114 | 117 |
| 115 // Map of profile_name to TestingProfile* from CreateTestingProfile(). | 118 // Map of profile_name to TestingProfile* from CreateTestingProfile(). |
| 116 TestingProfilesMap testing_profiles_; | 119 TestingProfilesMap testing_profiles_; |
| 117 | 120 |
| 118 DISALLOW_COPY_AND_ASSIGN(TestingProfileManager); | 121 DISALLOW_COPY_AND_ASSIGN(TestingProfileManager); |
| 119 }; | 122 }; |
| 120 | 123 |
| 121 #endif // CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ | 124 #endif // CHROME_TEST_BASE_TESTING_PROFILE_MANAGER_H_ |
| OLD | NEW |