| 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.h" | 5 #include "chrome/test/base/testing_profile.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/base_paths.h" | 9 #include "base/base_paths.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 force_incognito_(false), | 273 force_incognito_(false), |
| 274 original_profile_(NULL), | 274 original_profile_(NULL), |
| 275 guest_session_(false), | 275 guest_session_(false), |
| 276 last_session_exited_cleanly_(true), | 276 last_session_exited_cleanly_(true), |
| 277 browser_context_dependency_manager_( | 277 browser_context_dependency_manager_( |
| 278 BrowserContextDependencyManager::GetInstance()), | 278 BrowserContextDependencyManager::GetInstance()), |
| 279 resource_context_(NULL), | 279 resource_context_(NULL), |
| 280 delegate_(NULL), | 280 delegate_(NULL), |
| 281 profile_name_(kTestingProfile) { | 281 profile_name_(kTestingProfile) { |
| 282 CreateTempProfileDir(); | 282 CreateTempProfileDir(); |
| 283 profile_path_ = temp_dir_.path(); | 283 profile_path_ = temp_dir_.GetPath(); |
| 284 | 284 |
| 285 Init(); | 285 Init(); |
| 286 FinishInit(); | 286 FinishInit(); |
| 287 } | 287 } |
| 288 | 288 |
| 289 TestingProfile::TestingProfile(const base::FilePath& path) | 289 TestingProfile::TestingProfile(const base::FilePath& path) |
| 290 : start_time_(Time::Now()), | 290 : start_time_(Time::Now()), |
| 291 testing_prefs_(NULL), | 291 testing_prefs_(NULL), |
| 292 force_incognito_(false), | 292 force_incognito_(false), |
| 293 original_profile_(NULL), | 293 original_profile_(NULL), |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 resource_context_(NULL), | 356 resource_context_(NULL), |
| 357 delegate_(delegate), | 357 delegate_(delegate), |
| 358 profile_name_(profile_name), | 358 profile_name_(profile_name), |
| 359 policy_service_(policy_service.release()) { | 359 policy_service_(policy_service.release()) { |
| 360 if (parent) | 360 if (parent) |
| 361 parent->SetOffTheRecordProfile(std::unique_ptr<Profile>(this)); | 361 parent->SetOffTheRecordProfile(std::unique_ptr<Profile>(this)); |
| 362 | 362 |
| 363 // If no profile path was supplied, create one. | 363 // If no profile path was supplied, create one. |
| 364 if (profile_path_.empty()) { | 364 if (profile_path_.empty()) { |
| 365 CreateTempProfileDir(); | 365 CreateTempProfileDir(); |
| 366 profile_path_ = temp_dir_.path(); | 366 profile_path_ = temp_dir_.GetPath(); |
| 367 } | 367 } |
| 368 | 368 |
| 369 // Set any testing factories prior to initializing the services. | 369 // Set any testing factories prior to initializing the services. |
| 370 for (TestingFactories::const_iterator it = factories.begin(); | 370 for (TestingFactories::const_iterator it = factories.begin(); |
| 371 it != factories.end(); ++it) { | 371 it != factories.end(); ++it) { |
| 372 it->first->SetTestingFactory(this, it->second); | 372 it->first->SetTestingFactory(this, it->second); |
| 373 } | 373 } |
| 374 | 374 |
| 375 Init(); | 375 Init(); |
| 376 // If caller supplied a delegate, delay the FinishInit invocation until other | 376 // If caller supplied a delegate, delay the FinishInit invocation until other |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1089 // Note: Owned by |original_profile|. | 1089 // Note: Owned by |original_profile|. |
| 1090 return new TestingProfile(path_, delegate_, | 1090 return new TestingProfile(path_, delegate_, |
| 1091 #if defined(ENABLE_EXTENSIONS) | 1091 #if defined(ENABLE_EXTENSIONS) |
| 1092 extension_policy_, | 1092 extension_policy_, |
| 1093 #endif | 1093 #endif |
| 1094 std::move(pref_service_), original_profile, | 1094 std::move(pref_service_), original_profile, |
| 1095 guest_session_, supervised_user_id_, | 1095 guest_session_, supervised_user_id_, |
| 1096 std::move(policy_service_), testing_factories_, | 1096 std::move(policy_service_), testing_factories_, |
| 1097 profile_name_); | 1097 profile_name_); |
| 1098 } | 1098 } |
| OLD | NEW |