| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_TESTING_PROFILE_H_ | 5 #ifndef CHROME_TEST_TESTING_PROFILE_H_ |
| 6 #define CHROME_TEST_TESTING_PROFILE_H_ | 6 #define CHROME_TEST_TESTING_PROFILE_H_ |
| 7 | 7 |
| 8 #include "base/base_paths.h" | 8 #include "base/base_paths.h" |
| 9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 return web_data_service_.get(); | 147 return web_data_service_.get(); |
| 148 } | 148 } |
| 149 virtual PasswordStore* GetPasswordStore(ServiceAccessType access) { | 149 virtual PasswordStore* GetPasswordStore(ServiceAccessType access) { |
| 150 return NULL; | 150 return NULL; |
| 151 } | 151 } |
| 152 virtual PrefService* GetPrefs() { | 152 virtual PrefService* GetPrefs() { |
| 153 if (!prefs_.get()) { | 153 if (!prefs_.get()) { |
| 154 FilePath prefs_filename = | 154 FilePath prefs_filename = |
| 155 path_.Append(FILE_PATH_LITERAL("TestPreferences")); | 155 path_.Append(FILE_PATH_LITERAL("TestPreferences")); |
| 156 | 156 |
| 157 prefs_.reset(new PrefService(new PrefValueStore( | 157 prefs_.reset(PrefService::CreateUserPrefService(prefs_filename)); |
| 158 NULL, /* no managed preference values */ | |
| 159 new JsonPrefStore( /* user defined preference values */ | |
| 160 prefs_filename, | |
| 161 ChromeThread::GetMessageLoopProxyForThread(ChromeThread::FILE)), | |
| 162 NULL /* no suggested preference values */))); | |
| 163 Profile::RegisterUserPrefs(prefs_.get()); | 158 Profile::RegisterUserPrefs(prefs_.get()); |
| 164 browser::RegisterAllPrefs(prefs_.get(), prefs_.get()); | 159 browser::RegisterAllPrefs(prefs_.get(), prefs_.get()); |
| 165 } | 160 } |
| 166 return prefs_.get(); | 161 return prefs_.get(); |
| 167 } | 162 } |
| 168 virtual TemplateURLModel* GetTemplateURLModel() { | 163 virtual TemplateURLModel* GetTemplateURLModel() { |
| 169 return template_url_model_.get(); | 164 return template_url_model_.get(); |
| 170 } | 165 } |
| 171 virtual TemplateURLFetcher* GetTemplateURLFetcher() { return NULL; } | 166 virtual TemplateURLFetcher* GetTemplateURLFetcher() { return NULL; } |
| 172 virtual history::TopSites* GetTopSites() { return NULL; } | 167 virtual history::TopSites* GetTopSites() { return NULL; } |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 | 381 |
| 387 virtual ProfileId GetRuntimeId() { | 382 virtual ProfileId GetRuntimeId() { |
| 388 return original_profile_->GetRuntimeId(); | 383 return original_profile_->GetRuntimeId(); |
| 389 } | 384 } |
| 390 | 385 |
| 391 protected: | 386 protected: |
| 392 Profile* original_profile_; | 387 Profile* original_profile_; |
| 393 }; | 388 }; |
| 394 | 389 |
| 395 #endif // CHROME_TEST_TESTING_PROFILE_H_ | 390 #endif // CHROME_TEST_TESTING_PROFILE_H_ |
| OLD | NEW |