| 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_H_ | 5 #ifndef CHROME_TEST_BASE_TESTING_PROFILE_H_ |
| 6 #define CHROME_TEST_BASE_TESTING_PROFILE_H_ | 6 #define CHROME_TEST_BASE_TESTING_PROFILE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/scoped_temp_dir.h" | 10 #include "base/files/scoped_temp_dir.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 bool CreateHistoryService(bool delete_file, bool no_db) WARN_UNUSED_RESULT; | 175 bool CreateHistoryService(bool delete_file, bool no_db) WARN_UNUSED_RESULT; |
| 176 | 176 |
| 177 // Shuts down and nulls out the reference to HistoryService. | 177 // Shuts down and nulls out the reference to HistoryService. |
| 178 void DestroyHistoryService(); | 178 void DestroyHistoryService(); |
| 179 | 179 |
| 180 // Creates TopSites. This returns immediately, and top sites may not be | 180 // Creates TopSites. This returns immediately, and top sites may not be |
| 181 // loaded. Use BlockUntilTopSitesLoaded to ensure TopSites has finished | 181 // loaded. Use BlockUntilTopSitesLoaded to ensure TopSites has finished |
| 182 // loading. | 182 // loading. |
| 183 void CreateTopSites(); | 183 void CreateTopSites(); |
| 184 | 184 |
| 185 // Allows to set a test implementation |top_sites|. Testing profile owns |
| 186 // the reference and is responsible for releasing memory. |
| 187 void SetTopSites(history::TopSites* top_sites); |
| 188 |
| 185 // Shuts down and nulls out the reference to TopSites. | 189 // Shuts down and nulls out the reference to TopSites. |
| 186 void DestroyTopSites(); | 190 void DestroyTopSites(); |
| 187 | 191 |
| 188 // Creates the BookmarkBarModel. If not invoked the bookmark bar model is | 192 // Creates the BookmarkBarModel. If not invoked the bookmark bar model is |
| 189 // NULL. If |delete_file| is true, the bookmarks file is deleted first, then | 193 // NULL. If |delete_file| is true, the bookmarks file is deleted first, then |
| 190 // the model is created. As TestingProfile deletes the directory containing | 194 // the model is created. As TestingProfile deletes the directory containing |
| 191 // the files used by HistoryService, the boolean only matters if you're | 195 // the files used by HistoryService, the boolean only matters if you're |
| 192 // recreating the BookmarkModel. | 196 // recreating the BookmarkModel. |
| 193 // | 197 // |
| 194 // NOTE: this does not block until the bookmarks are loaded. For that use | 198 // NOTE: this does not block until the bookmarks are loaded. For that use |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 | 412 |
| 409 // Weak pointer to a delegate for indicating that a profile was created. | 413 // Weak pointer to a delegate for indicating that a profile was created. |
| 410 Delegate* delegate_; | 414 Delegate* delegate_; |
| 411 | 415 |
| 412 std::string profile_name_; | 416 std::string profile_name_; |
| 413 | 417 |
| 414 scoped_ptr<policy::PolicyService> policy_service_; | 418 scoped_ptr<policy::PolicyService> policy_service_; |
| 415 }; | 419 }; |
| 416 | 420 |
| 417 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ | 421 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ |
| OLD | NEW |