| 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 #include "chrome/test/base/testing_profile_manager.h" | 5 #include "chrome/test/base/testing_profile_manager.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/extensions/extension_special_storage_policy.h" | 9 #include "chrome/browser/extensions/extension_special_storage_policy.h" |
| 10 #include "chrome/browser/prefs/pref_service_syncable.h" | 10 #include "chrome/browser/prefs/pref_service_syncable.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 | 22 |
| 23 namespace testing { | 23 namespace testing { |
| 24 | 24 |
| 25 class ProfileManager : public ::ProfileManagerWithoutInit { | 25 class ProfileManager : public ::ProfileManagerWithoutInit { |
| 26 public: | 26 public: |
| 27 explicit ProfileManager(const base::FilePath& user_data_dir) | 27 explicit ProfileManager(const base::FilePath& user_data_dir) |
| 28 : ::ProfileManagerWithoutInit(user_data_dir) {} | 28 : ::ProfileManagerWithoutInit(user_data_dir) {} |
| 29 | 29 |
| 30 protected: | 30 protected: |
| 31 virtual Profile* CreateProfileHelper( | 31 virtual Profile* CreateProfileHelper( |
| 32 const base::FilePath& file_path) OVERRIDE { | 32 const base::FilePath& file_path) override { |
| 33 return new TestingProfile(file_path); | 33 return new TestingProfile(file_path); |
| 34 } | 34 } |
| 35 }; | 35 }; |
| 36 | 36 |
| 37 } // namespace testing | 37 } // namespace testing |
| 38 | 38 |
| 39 TestingProfileManager::TestingProfileManager(TestingBrowserProcess* process) | 39 TestingProfileManager::TestingProfileManager(TestingBrowserProcess* process) |
| 40 : called_set_up_(false), | 40 : called_set_up_(false), |
| 41 browser_process_(process), | 41 browser_process_(process), |
| 42 local_state_(process), | 42 local_state_(process), |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 << "ProfileManager already exists"; | 200 << "ProfileManager already exists"; |
| 201 | 201 |
| 202 // Set up the directory for profiles. | 202 // Set up the directory for profiles. |
| 203 ASSERT_TRUE(profiles_dir_.CreateUniqueTempDir()); | 203 ASSERT_TRUE(profiles_dir_.CreateUniqueTempDir()); |
| 204 | 204 |
| 205 profile_manager_ = new testing::ProfileManager(profiles_dir_.path()); | 205 profile_manager_ = new testing::ProfileManager(profiles_dir_.path()); |
| 206 browser_process_->SetProfileManager(profile_manager_); // Takes ownership. | 206 browser_process_->SetProfileManager(profile_manager_); // Takes ownership. |
| 207 | 207 |
| 208 called_set_up_ = true; | 208 called_set_up_ = true; |
| 209 } | 209 } |
| OLD | NEW |